Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimeon Andreev2018-04-19 07:54:25 +0000
committerSimeon Andreev2018-04-20 15:19:39 +0000
commita7bdb7b18497c21b22a979c96dbcb5e3458f925d (patch)
tree3dc6f940c0ec316cbc659906039bca398102b341 /tests
parentf705132b505acb5a99a954ce2a4d6a4e82245e41 (diff)
downloadeclipse.platform.swt-a7bdb7b18497c21b22a979c96dbcb5e3458f925d.tar.gz
eclipse.platform.swt-a7bdb7b18497c21b22a979c96dbcb5e3458f925d.tar.xz
eclipse.platform.swt-a7bdb7b18497c21b22a979c96dbcb5e3458f925d.zip
Bug 533799 - shrinking trees/tables can cause errors on standard error
Resizing a GTK tree view so that the column header and the horizontal scrollbar overlap causes pixman bug error messages on standard error. Using standard GTK3 API, it doesn't seem possible to resize the table the tree view in such a way. SWT on the other hand allows this. This change ensures that the SWT fixed which contains the tree or table is resized as requested by resize operation, while the tree or table retains some minimum height to avoid the error. In result, parts of the horizontal scrollbar are no longer visible, when the tree or table is shrinked below about 40px, the column headers and the horizontal scrollbar are visible. Change-Id: I3b39596a0f4eba3e1bbb259ab30d9d8744bb62c1 Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533799_shrinking_table_too_much_causes_pixman_errors_on_standard_error.java62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533799_shrinking_table_too_much_causes_pixman_errors_on_standard_error.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533799_shrinking_table_too_much_causes_pixman_errors_on_standard_error.java
new file mode 100644
index 0000000000..85d9faf454
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533799_shrinking_table_too_much_causes_pixman_errors_on_standard_error.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Simeon Andreev 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:
+ * Simeon Andreev - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+/**
+ * Description: Drawing an image with a paint listener of a {@link Group} yields wrong results,
+ * namely the drawing is done in the group area and not in client area of the group.
+ * This causes problems e.g. with JFace ControlDecoration.
+ * Steps to reproduce:
+ * <ol>
+ * <li>Run the snippet.</li>
+ * <li>Resize the shell to its minimum height.</li>
+ * </ol>
+ * Expected results: The shell contains a barely visible table, the standard out and error are empty.
+ * Actual results: The standard error contains messages that indicate "invalid rectangle passed".
+ */
+public class Bug533799_shrinking_table_too_much_causes_pixman_errors_on_standard_error {
+
+ public static void main(String[] args) {
+ final Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout(SWT.VERTICAL));
+ shell.setSize(300, 100);
+ shell.setText("Bug 533799 errors on standard error");
+
+ Table table = new Table(shell, SWT.BORDER);
+ table.setHeaderVisible(true);
+
+ for (int i = 0; i < 2; ++i) {
+ TableColumn column = new TableColumn(table, SWT.NONE);
+ column.setText("column " + i);
+ column.setWidth(150);
+ }
+
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+}

Back to the top