Community
Participate
Working Groups
I20060725-0800 The snippet below opens two shells. With the second shell still active, start a drag operation to select some characters in the text field of the first shell. => The first mouse down event in the parent shell does not get through to the text widget. The same problem can be reproduced in an Eclipse Java editor when the Ctrl+O dialog is up. The problem is in the call to childShell.close() in the body of new ShellAdapter() {...}.shellDeactivated(..). A workaround is to close the child shell in an asyncExec (set ASYNC to true). However, I think this bug should be fixed in the SWT layer. public class CloseModeless { static final boolean ASYNC= true; public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(); shell.setLayout(new GridLayout()); Text text= new Text(shell, SWT.WRAP); text.setText("Lorem ipsum dolor sit amet, ..."); shell.pack(); shell.open(); final Shell childShell= new Shell(shell); Rectangle b= shell.getBounds(); childShell.setBounds(b.x + b.width - 20, b.y + b.height - 20, b.width, b.height); childShell.open(); childShell.addShellListener(new ShellAdapter() { public void shellDeactivated(ShellEvent e) { if (ASYNC) { childShell.getDisplay().asyncExec(new Runnable() { public void run() { childShell.close(); } }); } else { childShell.close(); } } }); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } }
Any chance that this bug gets considered for one of the next milestones? If not, I'll ask Platform/UI to use the workaround in PopupDialog for now.
Sure, let me look into it.
Ok, I failed. Instead of closing the shell, I tried hiding it. It seems that changing the focus in WM_ACTIVATE on Windows causes the trouble. In any case, a quick fix doesn't seem to be in the cards. I'll continue to investigate, but you'd better asnycExec() for now. Sorry about that.
Returning to queue. SWT team please adjust milestone is necessary. Would be nice to remove the workaround in platform UI (PopupDialog).
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. -- The automated Eclipse Genie.