diff options
author | Eric Williams | 2017-12-20 19:09:26 +0000 |
---|---|---|
committer | Eric Williams | 2018-01-02 16:30:27 +0000 |
commit | a33fd2d662fa641d0771b9bf96b8eb1ea18cbc06 (patch) | |
tree | b6ba219d7beef37e477d06c9e68fb87bccd59302 | |
parent | e89202f94fd9028ef22d9b993750063ae2b16dfd (diff) | |
download | eclipse.platform.swt-a33fd2d662fa641d0771b9bf96b8eb1ea18cbc06.tar.gz eclipse.platform.swt-a33fd2d662fa641d0771b9bf96b8eb1ea18cbc06.tar.xz eclipse.platform.swt-a33fd2d662fa641d0771b9bf96b8eb1ea18cbc06.zip |
Bug 529026: [GTK3.20+] Test failures in org.eclipse.ui.tests.forms
Call gtk_widget_queue_resize() on the scrollbar to ensure the size
reported is the correct one. On GTK3.20+, the size sometimes lags a bit
(calling gtk_widget_get_preferred_size() demonstrates this). This causes
failing test cases in org.eclipse.ui.tests.forms.
Change-Id: Ia037808d36d04965d14a9940f3cad98b1c0982f4
Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java index d71b9dc48c..b65ea083da 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java @@ -368,6 +368,14 @@ int hScrollBarWidth() { hBarHandle = OS.gtk_scrolled_window_get_hscrollbar (scrolledHandle); if (hBarHandle==0) return 0; GtkRequisition requisition = new GtkRequisition(); + /* + * Feature in GTK3: sometimes the size reported lags on GTK3.20+. + * Calling gtk_widget_queue_resize() before querying the size + * fixes this issue. + */ + if (OS.GTK_VERSION >= OS.VERSION(3, 20, 0)) { + OS.gtk_widget_queue_resize (hBarHandle); + } gtk_widget_get_preferred_size (hBarHandle, requisition); int [] padding = new int [1]; OS.gtk_widget_style_get(scrolledHandle, OS.scrollbar_spacing, padding, 0); |