diff options
author | Alexander Kurtakov | 2017-09-05 06:33:00 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-09-05 06:34:06 +0000 |
commit | 7f7a87485459ea135ad1838fa719063d376ee7cd (patch) | |
tree | c9f73f5bcd1f415b5306fdd27059d22ce6284ca4 /bundles/org.eclipse.swt/Eclipse SWT | |
parent | be8a8d3889608163a807dc45281bf92934c712ec (diff) | |
download | eclipse.platform.swt-7f7a87485459ea135ad1838fa719063d376ee7cd.tar.gz eclipse.platform.swt-7f7a87485459ea135ad1838fa719063d376ee7cd.tar.xz eclipse.platform.swt-7f7a87485459ea135ad1838fa719063d376ee7cd.zip |
Bug 519808 - [GTK] Shell.getBounds returns obsolete values
Using gdk_window_get_root_origin before it's mapped returns 0,0
coordinates. As gtk_window_get_position returns correct coordinates in
general except after unmap when it returns the last "set" coordinates
gdk_window_get_root_origin should be used only for DISPOSE_SENT to
retrieve the last real coordinates.
Change-Id: I1f9f6ad8df62fb246f6219c54a085e4c4dbdd97e
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index 5f51873108..8788256055 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -2730,7 +2730,11 @@ public void forceActive () { Rectangle getBoundsInPixels () { checkWidget (); int [] x = new int [1], y = new int [1]; - OS.gdk_window_get_root_origin(OS.gtk_widget_get_window(shellHandle), x, y); + if ((state & Widget.DISPOSE_SENT) == 0) { + OS.gtk_window_get_position (shellHandle, x, y); + } else { + OS.gdk_window_get_root_origin(OS.gtk_widget_get_window(shellHandle), x, y); + } GtkAllocation allocation = new GtkAllocation (); OS.gtk_widget_get_allocation (vboxHandle, allocation); int width = allocation.width; |