Project: SWT
Bug 164755 Inconsistent z-order for ON_TOP shells between win32 and MacOS
Reported: 2006-11-15 22:23:34 | Status: resolved fixed

I want to create several shells that all of them have the SWT.ON_TOP style. When i run the SWT code on Window platform, the z-order is that the first created shell is putted on deep, the last created shell is putted on top. But if run the code on MacOS, the z-order is reversal, the last created shell is on deep, the first created shell is on top. This is inconsistent between platforms. this is the code snippet: public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout(new FillLayout()); Shell tipShell1 = new Shell(Display.getDefault(),SWT.ON_TOP ); tipShell1.pack(); tipShell1.setSize(50,300); tipShell1.setVisible(true); tipShell1.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GREEN)); Shell tipShell2 = new Shell(Display.getDefault(),SWT.ON_TOP); tipShell2.pack(); tipShell2.setSize(200,50); tipShell2.setVisible(true); tipShell2.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED)); Shell tipShell3 = new Shell(Display.getDefault(),SWT.ON_TOP ); tipShell3.pack(); tipShell3.setSize(100,100); tipShell3.setVisible(true); tipShell3.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE)); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java