Project: SWT
Bug 250327 SWT.NO_TRIM Shells cannot become the key window
Reported: 2008-10-09 15:24:16 | Status: resolved fixed

- snippet is below - this appears in eclipse when showing the context menu of the editor pane's CTabFolder, focus cannot be given to its contained Text static void setFocusInNO_TRIMshell() { final Display display = new Display(); final Shell shell = new Shell(display); shell.setBounds(10,10,200,200); shell.open(); shell.addListener(SWT.MouseDown, new Listener() { public void handleEvent(Event event) { Shell shell2 = new Shell(shell, SWT.NO_TRIM); shell2.setLayout(new FillLayout()); shell2.setSize(300,300); Composite composite = new Composite(shell2, SWT.NONE); composite.setLayout(new FillLayout()); Text text = new Text(composite, SWT.BORDER); shell2.open(); text.setFocus(); } }); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java