Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2018-11-19 21:23:08 +0000
committerXi Yan2018-11-20 18:36:17 +0000
commit513539323c6176382bd60e907c4fb5d185bd154b (patch)
tree0eaace76e1ce8c912d3542ac1dd81df7f1283656
parentf18da5d7e7f6c562601ba5be50c5260a2c407cc3 (diff)
downloadeclipse.platform.swt-513539323c6176382bd60e907c4fb5d185bd154b.tar.gz
eclipse.platform.swt-513539323c6176382bd60e907c4fb5d185bd154b.tar.xz
eclipse.platform.swt-513539323c6176382bd60e907c4fb5d185bd154b.zip
Bug 540163 - [Wayland] Markeplace dialog misrendered
When Marketplace dialog is opened for the first time, it somehow does not open before Shell#forceResize is called on Wayland, and GTK gives an incorrect allocation to the box container. The fix is to use the calculated box size if bounds have previously been set, so that Composite#getClientArea called from Layout#layout returns the right area. Change-Id: I12851f5e2f8965246e94c64cef5711895df1e5ca Signed-off-by: Xi Yan <xixiyan@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java14
1 files changed, 14 insertions, 0 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 a888dc9c86..20f04131b8 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
@@ -1013,6 +1013,20 @@ void fixStyle (long /*int*/ handle) {
void forceResize () {
GtkAllocation allocation = new GtkAllocation ();
GTK.gtk_widget_get_allocation (vboxHandle, allocation);
+ if (!OS.isX11()) {
+ /*
+ * Bug 540163: We sometimes are getting the container's allocation
+ * before Shell is fully opened, which gets an incorrect allocation.
+ * Fix is to use the calculated box width/height if bounds have been set.
+ */
+ int border = GTK.gtk_container_get_border_width (shellHandle);
+ int boxWidth = oldWidth - 2*border;
+ int boxHeight = oldHeight - 2*border;
+ if (boxWidth != allocation.width || boxHeight != allocation.height) {
+ allocation.width = Math.max(boxWidth, allocation.width);
+ allocation.height = Math.max(boxHeight, allocation.height);
+ }
+ }
forceResize (allocation.width, allocation.height);
}

Back to the top