diff options
author | Alexandr Miloslavskiy | 2019-07-18 08:48:31 +0000 |
---|---|---|
committer | Eric Williams | 2019-07-18 13:13:53 +0000 |
commit | bb83b4b8555e367a0a9848af6b3ac425368e4e20 (patch) | |
tree | 0f9be50545d81b04bacc74965a679a9c504eeb7a /tests/org.eclipse.swt.tests.gtk | |
parent | ed73849c201f8d846dfa4c2d2a56cce318115e5a (diff) | |
download | eclipse.platform.swt-bb83b4b8555e367a0a9848af6b3ac425368e4e20.tar.gz eclipse.platform.swt-bb83b4b8555e367a0a9848af6b3ac425368e4e20.tar.xz eclipse.platform.swt-bb83b4b8555e367a0a9848af6b3ac425368e4e20.zip |
Bug 549376 - [Ubuntu 14.04] Native crash in OS._gtk_widget_show when creating RADIO MenuItem with UBUNTU_MENUPROXY
Change-Id: I477bdc394337f3d7942d846f1a1bc564b6ff33dc
Co-authored-by: Markus Keller <markus_keller@ch.ibm.com>
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.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/Bug549376_JvmCrashMenuRadio.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug549376_JvmCrashMenuRadio.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug549376_JvmCrashMenuRadio.java new file mode 100644 index 0000000000..bc28c11118 --- /dev/null +++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug549376_JvmCrashMenuRadio.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2019 Syntevo 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: + * Syntevo - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.tests.gtk.snippets; + +import org.eclipse.swt.*; +import org.eclipse.swt.layout.*; +import org.eclipse.swt.widgets.*; + +public class Bug549376_JvmCrashMenuRadio { + public static void main (String [] args) { + final Display display = new Display(); + final Shell shell = new Shell(display); + + FillLayout layout = new FillLayout(); + layout.marginHeight = layout.marginWidth = 10; + shell.setLayout(layout); + + Menu menuBar = new Menu(shell, SWT.BAR); + shell.setMenuBar(menuBar); + + MenuItem menu = new MenuItem(menuBar, SWT.CASCADE); + menu.setText("Menu"); + + final Menu subMenu = new Menu(menu); + menu.setMenu(subMenu); + + // Creating a RADIO item during SWT.FocusIn is one way to crash + shell.addListener(SWT.FocusIn, e -> { + new MenuItem(subMenu, SWT.RADIO); + }); + + Label hintLabel = new Label(shell, SWT.NONE); + hintLabel.setText("If you see this text, the crash didn't reproduce"); + + shell.pack(); + shell.open(); + + while (!shell.isDisposed ()) { + if (!display.readAndDispatch ()) display.sleep (); + } + + display.dispose (); + } +} |