Bug 131093 - AWT modal dialog
Summary: AWT modal dialog
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-09 09:44 EST by Egidijus Vaisnora CLA
Modified: 2019-09-06 16:18 EDT (History)
3 users (show)

See Also:


Attachments
Plugin project for eclipse (12.32 KB, application/x-zip-compressed)
2006-03-10 02:24 EST, Egidijus Vaisnora CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Egidijus Vaisnora CLA 2006-03-09 09:44:06 EST
If AWT modal dialog is showing up and at the same time is created view or editor with have embedded swing panel, then after closing dialog, this embedded panel can't receive event.
Comment 1 Steve Northover CLA 2006-03-09 13:52:25 EST
Please provide a small stand alone example that shows the problem and include the JDK version information.  Thanks.
Comment 2 Egidijus Vaisnora CLA 2006-03-10 02:24:21 EST
Created attachment 36041 [details]
Plugin project for eclipse

Here is plugin created on top of "Sample view" plugin. Open view from the Views-> Sample Category. Press Test button which shows modal dialog with button "NEW". Pressing "NEW" button will create secondary view with button "Test". Close dialog. Secondary view is not responsive.
Comment 3 Egidijus Vaisnora CLA 2006-03-10 14:54:51 EST
Forgot to mention - OS is Windows 2000 and Java is 1.5.0_06, however such behavior I got with Java 1.4.3 also
Comment 4 Egidijus Vaisnora CLA 2006-03-14 11:14:07 EST
Just want to know if you have reproduced this problem? It is one of the major stopper for my integration and any workaround are welcome.
Comment 5 Silenio Quarti CLA 2006-03-15 17:49:09 EST
I was able to reproduce it, but I still do not know what is the problem...
Comment 6 Silenio Quarti CLA 2006-03-16 12:54:51 EST
This looks like an AWT bug. The second EmbeddedFrame (created after the dialog is up) is not re-enabled after the dialog is hidden.

Oleg, could you confirm if this is really a bug in AWT and if there is any work around?

Here is a standalone app (no Eclipse) that reproduces the problem.

import java.awt.BorderLayout;
import java.awt.event.*;
import javax.swing.*;
import org.eclipse.swt.*;
import org.eclipse.swt.awt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class PR131093 {
	public static void main(String[] args) {
		final Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());
		Composite comp = new Composite(shell, SWT.EMBEDDED);
		final java.awt.Frame f1 = SWT_AWT.new_Frame(comp);
		JButton comp1 = new JButton("BUTTON");
		comp1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JDialog dlg= new JDialog((java.awt.Frame)null, "Gaidena", true);
				dlg.setLayout(new BorderLayout());
				JButton comp = new JButton("NEW");
				comp.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						display.asyncExec(new Runnable() {
							public void run () {
								final Shell shell = new Shell(display);
								shell.setLayout(new FillLayout());
								Composite comp = new Composite(shell, SWT.EMBEDDED);
								java.awt.Frame f1 = SWT_AWT.new_Frame(comp);
								JButton comp1 = new JButton("BUTTON");
								f1.add(comp1);
								shell.setBounds(50, 250, 200, 100);
								shell.open();
							}
						});
					}
				});
				dlg.add(BorderLayout.CENTER, comp);
				dlg.pack();
				dlg.setVisible(true);
//				java.awt.Frame[] frames = java.awt.Frame.getFrames();
//				for (int i = 0; i < frames.length; i++) {
//					System.out.println("frame=" + frames[i] + " " + frames[i].isEnabled());
//				}
			}
		});
		f1.add(comp1);
		shell.setBounds(50, 50, 200, 100);
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
	}
}
Comment 7 Egidijus Vaisnora CLA 2006-03-21 11:36:52 EST
Is any workaround for this problem?
Comment 8 Oleg Sukhodolsky CLA 2006-03-23 03:18:48 EST
I was able to reproduce the problem (btw it is not reproducible with current 
builds of 6.0)
I do not know the cause of this problem yet (need perform more investigation).
As soon as I will have more information I will post it.
Comment 9 Oleg Sukhodolsky CLA 2006-05-11 20:52:33 EDT
It looks like that this is the same as Sun's bug #6417395 (New IE applet window becomes unresponsive if it is launched after the modal dialog)
Comment 10 Eclipse Webmaster CLA 2019-09-06 16:18:39 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.