Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-05 06:33:00 +0000
committerAlexander Kurtakov2017-09-05 06:34:06 +0000
commit7f7a87485459ea135ad1838fa719063d376ee7cd (patch)
treec9f73f5bcd1f415b5306fdd27059d22ce6284ca4 /bundles/org.eclipse.swt/Eclipse SWT
parentbe8a8d3889608163a807dc45281bf92934c712ec (diff)
downloadeclipse.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.java6
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;

Back to the top