Community
Participate
Working Groups
I'm trying to get MDI-like behaviour out of SWT. I noticed from the API that I could add a Decorations to a Shell, which is sort of what I want (except that the main shell loses focus when the child Decorations is selected. The problem occurs if you select a Decorations and then switch to another application, either via clicking, Alt-TAB or the windows taskbar. You'll find that you can't get back to your application via ALT-TAB (it's disappeared) or the taskbar (clicking the button doesn't bring the application to the front). If you place the windows correctly you can see that the Decorations is getting the focus back when you click the taskbar button but it's just not coming to the front. Also, if you select the Decorations and do ALT-TAB you'll see that your application has disappeared even before you switch to any other application. Below is the code to create the application. Cheers, Alun import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.layout.FillLayout; public class Main { public static void main(String[] args) { Shell mainShell = new Shell(SWT.SHELL_TRIM); mainShell.setMaximized(true); mainShell.setLayout(new FillLayout()); Decorations dec = new Decorations(mainShell, SWT.SHELL_TRIM); dec.setVisible(true); mainShell.pack(); mainShell.open(); Display display = mainShell.getDisplay(); while (!mainShell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } }
Chrix to take a look.
Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=29891#c8 Decorations is not meant to be used. *** This bug has been marked as a duplicate of 29891 ***