Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2018-10-09 17:24:27 +0000
committerXi Yan2018-10-12 18:37:54 +0000
commitde6e88927bc6145d9afed2fbb1848e81f7702b14 (patch)
tree5ed1bac780ec63ef28e0078a9045f3384e694806 /tests/org.eclipse.swt.tests.gtk
parent8abd3686d9521f473531c3d8b80ff687636263eb (diff)
downloadeclipse.platform.swt-de6e88927bc6145d9afed2fbb1848e81f7702b14.tar.gz
eclipse.platform.swt-de6e88927bc6145d9afed2fbb1848e81f7702b14.tar.xz
eclipse.platform.swt-de6e88927bc6145d9afed2fbb1848e81f7702b14.zip
Bug 535075 - [Wayland] application rendered with an offset relatively to
host window On Wayland, calling gtk_widget_size_allocate with a relative position to the GtkContainer causes window contents to be rendered outside of the actual GtkWindow. The fix is to map container's coordinate relative to the window's coordinate, and render the position according to the relative coordinate. Tested with child Eclipse Tip of the Day on Wayland (Bug 536153). Change-Id: I93d26be94f57fcb7556f4fe683f41783d5ebcdbc Signed-off-by: Xi Yan <xixiyan@redhat.com>
Diffstat (limited to 'tests/org.eclipse.swt.tests.gtk')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535075_WaylandOffset.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535075_WaylandOffset.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535075_WaylandOffset.java
new file mode 100644
index 0000000000..2c15a53dc5
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535075_WaylandOffset.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Red Hat 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:
+ * Red Hat - 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.Button;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class Bug535075_WaylandOffset {
+
+ public static void main(String[] args) {
+
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+
+ Button b = new Button(shell, SWT.NONE);
+ b.setText("pushme");
+ b.addListener(SWT.Selection, event -> {
+ shell.requestLayout();
+ });
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+
+}

Back to the top