Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorXi Yan2018-09-17 20:57:49 +0000
committerAlexander Kurtakov2018-09-19 16:26:21 +0000
commit95e0cb1ec0942a6f24e42af56a2cb1c308d6d9b8 (patch)
treef36e90cb52abbbd4bda2d74f3e2847aa730a4330 /tests
parent88d1b75768576406aa3b4334fd9d44c4390b1646 (diff)
downloadeclipse.platform.swt-95e0cb1ec0942a6f24e42af56a2cb1c308d6d9b8.tar.gz
eclipse.platform.swt-95e0cb1ec0942a6f24e42af56a2cb1c308d6d9b8.tar.xz
eclipse.platform.swt-95e0cb1ec0942a6f24e42af56a2cb1c308d6d9b8.zip
Bug 533395 - [Gtk][Regression] Keyboard shortcuts are taken from first
item in "Input Source" instead of currently active input, thus breaking custom layouts (e.g Dvorak/Colemak/AZERTY) if it's not default layout. Previous patch to bug 61190 forces every keyboard layout to use any Latin layout group (depending on order of Map). For custom layouts that is a Latin layout group (i.e. contains alphabets a-z), there is no need to force an arbitrary Latin layout group for them as it might default to another layout if there are multiple input sources. Take the current active input layout if it is Latin group, otherwise take the default Latin group to prevent shortcuts not working for non-English keyboard. The patch applies to X11 only. On Wayland, GdkEventKey.group always defaults to the primary layout. Tested with attached snippet: Ctrl+i/Ctrl+. should copy/paste in both StyledText and Text in Dvorak. In child Eclipse: Ctrl+i/Ctrl+. copy/paste text in Dvorak, shortcuts should work under Russian keyboard. Change-Id: Iab4ee98060b3062bad1c5952436f2bed27225d07 Signed-off-by: Xi Yan <xixiyan@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533395_KeyboardShortcut.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533395_KeyboardShortcut.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533395_KeyboardShortcut.java
new file mode 100644
index 0000000000..ec2ad7bfbf
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug533395_KeyboardShortcut.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Red Hat and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Red Hat - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class Bug533395_KeyboardShortcut {
+ public static void main (String [] args) {
+ Display display = new Display ();
+ Shell shell = new Shell(display);
+
+ shell.setLayout(new FillLayout());
+
+ StyledText styledText = new StyledText(shell, SWT.BORDER);
+ styledText.setText("StyledText");
+
+ Text text = new Text(shell, SWT.BORDER);
+ text.setText("Text");
+
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+ }
+
+}

Back to the top