Community
Participate
Working Groups
KDE centers child shells around the parent window when they are first opened. This is caused by the following KDE bug: http://bugs.kde.org/show_bug.cgi?id=78082 This means that any call to Shell.setBounds before Shell.open will be discarded when running on KDE. SWT can work around this by explicitly restoring the shell's position after it opens.
See bug 52669
Sounds wrong. Does this mean that the shell will jump? FH to investigate.
Yes, the shell will jump. It's quite ugly, but since KDE intentionally ignores dialog positions until the dialog is visible, this might be the best we can do until KDE is fixed.
What version of KDE are you running ? On my machine (Redhat 9) it works as expect: The dialog is placed right on I set. import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; public class PR79462 { public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.addListener (SWT.MouseDown, new Listener () { public void handleEvent(Event event) { Shell dialog = new Shell (shell, SWT.DIALOG_TRIM); dialog.setBounds (10, 10, 100, 100); dialog.open(); while (!dialog.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
This was observed by Morten Moeller in bug 52669. I believe the info about his configuration is attached to that PR.
Nobody in the UI team can reproduce this problem ? Doug runs KDE all the time, he should know about this problem.
cc'ing Morten, Doug, and Billy, since they're the GTK experts. I filed this bug mainly so that the suggestions in bug 52669 didn't get lost now that a workaround exists.
Doug, can you comment on comment 6?
You need to run with a recent version of KDE (e.g., 3.2.x or 3.3.x), and you need to open a dialog. Opening a shell without a parent will not centre it on the screen. <2cents> I would not suggest repositioning the shell. It would be nice if we could actually create a shell as something like "GDK_WINDOW_TYPE_HINT_UTILITY". Talk to Billy; he knows more. </2cents>
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
I can't reproduce this issue with the snippet attached.
Yes, I believe this was fixed by the linked KDE bug.