diff options
| author | Ian Pun | 2016-12-05 18:59:53 +0000 |
|---|---|---|
| committer | Ian Pun | 2016-12-23 16:19:42 +0000 |
| commit | 84e82fe721d9d1daa6bf08d2610c9b23c1d59427 (patch) | |
| tree | 483b5da845fd5c535fa42075dd2a9a69c64d9d31 | |
| parent | 791616804ec119a50e38c42027cdcb9af53f1a12 (diff) | |
| download | eclipse.platform.swt-84e82fe721d9d1daa6bf08d2610c9b23c1d59427.tar.gz eclipse.platform.swt-84e82fe721d9d1daa6bf08d2610c9b23c1d59427.tar.xz eclipse.platform.swt-84e82fe721d9d1daa6bf08d2610c9b23c1d59427.zip | |
Bug 508692 - Shells has wrong size under wayland
Reason for that is that is the usage of GtkWindow allocation for the
shell size which would fail with CSD (Client Side Decoration) as window
decorations, shadows and etc. are part of the window allocation. It
exposes on Wayland and Broadway backends as they have no server side
decorations at all.
Reverted the patch to include conditional GTK3 checks as removing it
caused Bug 509596.
Change-Id: If7d3f45739bfd1849ff53eeee7c13f7024a05385
Signed-off-by: Ian Pun <ipun@redhat.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java | 18 |
1 files changed, 13 insertions, 5 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 838ca4aee3..5fd302b9e0 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 @@ -1548,11 +1548,19 @@ long /*int*/ gtk_key_press_event (long /*int*/ widget, long /*int*/ event) { @Override long /*int*/ gtk_size_allocate (long /*int*/ widget, long /*int*/ allocation) { - int[] widthArray = new int [1]; - int[] heightArray = new int [1]; - OS.gtk_window_get_size(shellHandle, widthArray, heightArray); - int width = widthArray[0]; - int height = heightArray[0]; + int width, height; + if (OS.GTK3) { + int[] widthA = new int [1]; + int[] heightA = new int [1]; + OS.gtk_window_get_size(shellHandle, widthA, heightA); + width = widthA[0]; + height = heightA[0]; + } else { + GtkAllocation widgetAllocation = new GtkAllocation (); + OS.gtk_widget_get_allocation (shellHandle, widgetAllocation); + width = widgetAllocation.width; + height = widgetAllocation.height; + } // Bug 474235: on Wayland gtk_size_allocate() is called more frequently, causing an // infinitely recursive resize call. This causes non-resizable Shells/Dialogs to |
