Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2019-04-16 10:51:44 -0400
committerEric Williams2019-04-16 11:15:49 -0400
commitbb98207d55709a339e0a6668837bc9377d627a44 (patch)
treee25c38d306d716e92225cfb8947b87e39d50d156
parentf4cff7872b771fc8b6e5080b5b256b174f68de3e (diff)
downloadeclipse.platform.swt-bb98207d55709a339e0a6668837bc9377d627a44.tar.gz
eclipse.platform.swt-bb98207d55709a339e0a6668837bc9377d627a44.tar.xz
eclipse.platform.swt-bb98207d55709a339e0a6668837bc9377d627a44.zip
Bug 546481: [GTK4] Fix Snippet4
Allocate to shellHandle so that drawing works properly -- otherwise the snapshot will stop at the child GtkWindow and nothing will be passed on to any of the children. This means the Shell would not draw. Change-Id: I62e7b845fdab99acb864aea86de7916e88829f3e Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java7
1 files changed, 5 insertions, 2 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 83dc2f8f8f..8a1178eee4 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
@@ -2138,7 +2138,7 @@ public void setAlpha (int alpha) {
}
void resizeBounds (int width, int height, boolean notify) {
- int border = 0;
+ int border = gtk_container_get_border_width_or_margin (shellHandle);
if (GTK.GTK4) {
if (redrawSurface != 0) {
GDK.gdk_surface_resize (redrawSurface, width, height);
@@ -2146,6 +2146,10 @@ void resizeBounds (int width, int height, boolean notify) {
if (redrawSurface != 0) {
GDK.gdk_surface_resize (redrawSurface, width, height);
}
+ GtkAllocation allocation = new GtkAllocation();
+ allocation.width = width;
+ allocation.height = height;
+ GTK.gtk_widget_size_allocate(shellHandle, allocation, -1);
} else {
if (redrawWindow != 0) {
GDK.gdk_window_resize (redrawWindow, width, height);
@@ -2153,7 +2157,6 @@ void resizeBounds (int width, int height, boolean notify) {
if (enableWindow != 0) {
GDK.gdk_window_resize (enableWindow, width, height);
}
- border = gtk_container_get_border_width_or_margin (shellHandle);
}
int boxWidth = width - 2*border;
int boxHeight = height - 2*border;

Back to the top