diff options
author | Eric Williams | 2018-12-17 20:43:17 +0000 |
---|---|---|
committer | Eric Williams | 2018-12-20 16:46:26 +0000 |
commit | 50c3e60ee63bf15523be8ccc716ff93e0828e94f (patch) | |
tree | f7bb5324628a2932ce6a201eed89289e35809ce5 /tests | |
parent | efd9a47494713d548ce099019b4f5bf810c09707 (diff) | |
download | eclipse.platform.swt-50c3e60ee63bf15523be8ccc716ff93e0828e94f.tar.gz eclipse.platform.swt-50c3e60ee63bf15523be8ccc716ff93e0828e94f.tar.xz eclipse.platform.swt-50c3e60ee63bf15523be8ccc716ff93e0828e94f.zip |
Bug 542865: [GTK4] Snippets with any children of Shell crash upon
gtk_widget_get_surface_allocation()
GTK4 no longer supports "own" surfaces for widgets, so this patch
removes this logic from the GTK4 SwtFixed implementation.
Some adjustments have to made in Control, as we do
gtk_widget_get_has_surface_or_window() checks to determine the
paintHandle. In GTK4 this is broken so always use the surface of the
fixedHandle (or clientHandle in the case of Group).
Change-Id: I09c0c096407ab67ac10edfcd21a3c9927cb5f833
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/Bug542865_ShellChildrenCrash.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542865_ShellChildrenCrash.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542865_ShellChildrenCrash.java new file mode 100644 index 0000000000..3c56a706e0 --- /dev/null +++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542865_ShellChildrenCrash.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * 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.RowLayout; +/* + * example snippet: Hello World + * + * For a list of all SWT example snippets see + * http://www.eclipse.org/swt/snippets/ + */ +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +public class Bug542865_ShellChildrenCrash { + +public static void main (String [] args) { + Display display = new Display (); + Shell shell = new Shell(display); + shell.setLayout(new RowLayout()); + Button button = new Button (shell, SWT.PUSH); + button.setText("Test push button"); + shell.open (); + while (!shell.isDisposed ()) { + if (!display.readAndDispatch ()) display.sleep (); + } + display.dispose (); +} +} |