Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Williams2018-03-07 19:25:32 +0000
committerEric Williams2018-04-30 17:38:38 +0000
commit7b0cb58a2aedcac5c0973ddf0a9b4ab467c9e875 (patch)
tree5c96c6aed481d1d6a3ace28cf81ee14aed7e4acc /tests
parentac26e5b193678c550d5c4460d9b7071c8275d183 (diff)
downloadeclipse.platform.swt-7b0cb58a2aedcac5c0973ddf0a9b4ab467c9e875.tar.gz
eclipse.platform.swt-7b0cb58a2aedcac5c0973ddf0a9b4ab467c9e875.tar.xz
eclipse.platform.swt-7b0cb58a2aedcac5c0973ddf0a9b4ab467c9e875.zip
Bug 500703: [GTK3.20+] Combo with SWT.READ_ONLY is garbled upon re-size
In GTK3.20+ two things inside GTK3 changed. First, certain widgets have their clips unioned with the clips of their parent widget. This can cause overdrawing in widgets like Combo. Second, the internal widget hierarchy of Combo changed, and most of the resizing is done by a GtkBox instead of GtkComboBox itself. These two changes combined caused this bug. The overdrawing causes the Combo to draw over its neighbouring widgets (like a label). The resize issue means that resizing the widget doesn't cause it get smaller: the x coordinates of the allocation and clip just become negative and the whole widget shifts to the left. The fix is to adjust the clip and allocation of the Combo and its children from the parent Composite's draw handler. This ensures that the Combo is drawn with correct coordinates and that it actually shrinks when resized, instead of just shifting. Tested on GTK3.22, X11 and Wayland. Window -> Preferences -> General -> Keys behaves as expected, and no AllNonBrowser JUnit tests fail. Change-Id: Ic603acfda924b0ca36b4f0ba07048f6762c99270 Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500703_ComboGarbledResize.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500703_ComboGarbledResize.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500703_ComboGarbledResize.java
index 6c373985c0..f664bc2a5d 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500703_ComboGarbledResize.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500703_ComboGarbledResize.java
@@ -43,8 +43,15 @@ public class Bug500703_ComboGarbledResize {
Combo text = new Combo(shell, SWT.READ_ONLY);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
text.add("This is a very long long long long long box");
+ text.add("short");
+
+ // Uncomment to test different selections
+// text.select(0);
+// text.select(1);
shell.pack();
+ // Uncomment for setBounds testing
+// shell.setSize(400, 200);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())

Back to the top