Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Williams2019-08-07 21:04:52 +0000
committerEric Williams2019-08-19 19:57:19 +0000
commitbe9f3ff707e25f4aa304df53c2b712b9678a7772 (patch)
tree7199a2ffbcf81d443f6101fd17b64b9f6ae4507f /tests
parent9a567f2fc20ace7db6af41dca7c20c5c05bf7525 (diff)
downloadeclipse.platform.swt-be9f3ff707e25f4aa304df53c2b712b9678a7772.tar.gz
eclipse.platform.swt-be9f3ff707e25f4aa304df53c2b712b9678a7772.tar.xz
eclipse.platform.swt-be9f3ff707e25f4aa304df53c2b712b9678a7772.zip
Bug 541427: [GTK3][X11] Tree with no items and the size of the header is blank
A change in the GTK3.20 drawing model means that Trees without any items will have blank headers (not drawn). The fix is to ensure that a window-system native window is created for the Tree. Only X11 is affected by this bug, Trees on Wayland behave normally. Tested on GTK3.24 on X11 and Wayland, using the snippet attached and a child Eclipse. No AllNonBrowser JUnit tests fail. Change-Id: I5f8528b43a5ed41d652c663637673385d5eed945 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/Bug541427_TreeNoHeader.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug541427_TreeNoHeader.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug541427_TreeNoHeader.java
new file mode 100644
index 0000000000..b5da42f115
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug541427_TreeNoHeader.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Matthew Khouzam and others. All rights reserved.
+ * The contents of this file are made available under the terms
+ * of the GNU Lesser General Public License (LGPL) Version 2.1 that
+ * accompanies this distribution (lgpl-v21.txt). The LGPL is also
+ * available at http://www.gnu.org/licenses/lgpl.html. If the version
+ * of the LGPL at http://www.gnu.org is different to the version of
+ * the LGPL accompanying this distribution and there is any conflict
+ * between the two license versions, the terms of the LGPL accompanying
+ * this distribution shall govern.
+ *
+ * Contributors:
+ * Matthew Khouzam - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+public class Bug541427_TreeNoHeader {
+ public static void main(String[] args) {
+ // useless setup
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setSize(new Point(300, 200));
+
+ final Tree tree = new Tree(shell, SWT.NO_SCROLL);
+ tree.setHeaderVisible(true);
+ tree.setBounds(0, 0, 300, tree.getHeaderHeight());
+ TreeColumn col1 = new TreeColumn(tree, SWT.NONE);
+ col1.setText("Hi Mom!");
+ col1.setWidth(200);
+ TreeColumn col2 = new TreeColumn(tree, SWT.NONE);
+ col2.setText("Hi Dad!");
+ col2.setWidth(200);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+}

Back to the top