Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 79462 - [Widgets] Child shells change their position when opened under KDE
Summary: [Widgets] Child shells change their position when opened under KDE
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Felipe Heidrich CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-24 21:56 EST by Stefan Xenos CLA
Modified: 2016-10-18 11:26 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2004-11-24 21:56:14 EST
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.
Comment 1 Stefan Xenos CLA 2004-11-24 21:57:22 EST
See bug 52669
Comment 2 Steve Northover CLA 2004-11-25 10:57:19 EST
Sounds wrong.  Does this mean that the shell will jump?  FH to investigate.
Comment 3 Stefan Xenos CLA 2004-11-25 13:29:31 EST
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.
Comment 4 Felipe Heidrich CLA 2004-11-25 18:12:16 EST
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();
}
}

Comment 5 Stefan Xenos CLA 2004-11-25 20:25:32 EST
This was observed by Morten Moeller in bug 52669. I believe the info about his
configuration is attached to that PR.
Comment 6 Felipe Heidrich CLA 2004-11-29 11:01:40 EST
Nobody in the UI team can reproduce this problem ?
Doug runs KDE all the time, he should know about this problem.
Comment 7 Stefan Xenos CLA 2004-11-29 14:23:10 EST
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.
Comment 8 Stefan Xenos CLA 2004-11-29 14:24:10 EST
Doug, can you comment on comment 6?
Comment 9 Douglas Pollock CLA 2004-11-29 15:55:43 EST
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> 
Comment 10 Felipe Heidrich CLA 2009-08-18 11:15:53 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 11 Eric Williams CLA 2016-10-18 11:20:50 EDT
I can't reproduce this issue with the snippet attached.
Comment 12 Stefan Xenos CLA 2016-10-18 11:26:47 EDT
Yes, I believe this was fixed by the linked KDE bug.