Community
Participate
Working Groups
I created shell with SWT.TOOL style to create drop shadow effect, when I put CCombo and click to show its dropdown, the shell's drop shadow effect suddenly disappears. If you click outside the shell then click the shell again the drop shadow shows up again. I have workaround about this issue by adding SWT.ON_TOP on the shell but when the shell is on focus and I minimize the application, the shell keeps showing up. I don't want this behaviour. Regards, Setya
Created attachment 36866 [details] Screenshot before the CCombo's dropdown shown
Created attachment 36867 [details] Screenshot after the CCombo's dropdown shown
What an interesting bug.
WORKSFORME. Please reopen with code that fails or edit this code so it fails: import org.eclipse.swt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.custom.*; public class PR_133098 { public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display, SWT.TOOL); shell.setLayout(new FillLayout()); CCombo combo = new CCombo (shell, SWT.NONE); combo.setItems (new String [] {"FRED", "JOE", "MARY"}); combo.select (1); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
I believe he was talking about this: import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CCombo; import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class Test { public static void main(String[] args) { Display display = new Display(); final Shell rootShell = new Shell(display); final Shell toolShell = new Shell(rootShell, SWT.TOOL); toolShell.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); CCombo combo = new CCombo (toolShell, SWT.BORDER); combo.setItems (new String [] {"FRED", "JOE", "MARY"}); combo.setBounds(50, 40, combo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, combo.computeSize(SWT.DEFAULT, SWT.DEFAULT).y); combo.select(1); toolShell.setSize(150, 120); toolShell.open(); rootShell.addControlListener(new ControlListener() { @Override public void controlResized(ControlEvent e) { x(); } @Override public void controlMoved(ControlEvent e) { x(); } private void x() { Rectangle rootBounds = rootShell.getBounds(); int centerX = rootBounds.x + rootBounds.width / 2; int centerY = rootBounds.y + rootBounds.height / 2; toolShell.setLocation( centerX - toolShell.getBounds().width / 2, centerY - toolShell.getBounds().height / 2 ); } }); rootShell.setSize(400, 300); rootShell.open(); while (!rootShell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }