diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2013-07-01 10:12:42 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2013-07-01 10:12:42 -0400 |
commit | eba184151123c18e9cca5e07c8b341635da8dd04 (patch) | |
tree | f662df9d2ca824a03afef0812e02248b58056546 | |
parent | 48182d20aa1f64b7236dd904a9fb69ad577aead7 (diff) | |
download | eclipse.platform.swt-widget_show_2.tar.gz eclipse.platform.swt-widget_show_2.tar.xz eclipse.platform.swt-widget_show_2.zip |
[GTK 3.8] Widget's size cannot be allocated before it is shownwidget_show_2
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index 0bd3b6e410..525fd0ed58 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -987,7 +987,17 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize allocation.width = width; allocation.height = height; } - OS.gtk_widget_size_allocate (topHandle, allocation); + /* + * The widget needs to be shown before its size is allocated + * in GTK 3.8 otherwise its allocation return 0 + */ + if (!OS.gtk_widget_get_visible(handle)) { + OS.gtk_widget_show(handle); + OS.gtk_widget_size_allocate (topHandle, allocation); + OS.gtk_widget_hide(handle); + } else { + OS.gtk_widget_size_allocate (topHandle, allocation); + } } /* * Bug in GTK. Widgets cannot be sized smaller than 1x1. |