[PATCH v2 xfce4-terminal] Do not reset scroll on AltGr
Mihail Konev
k.mvc at ya.ru
Thu Jan 5 17:53:02 CET 2017
---
v2: use a separate function
terminal/terminal-widget.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index af7f3e416417..3dd10ccf7611 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -600,6 +600,37 @@ terminal_widget_drag_data_received (GtkWidget *widget,
static gboolean
+is_keystroke_keysym(gint32 keyval) {
+ switch (keyval)
+ {
+ case GDK_ISO_Lock:
+ case GDK_ISO_Level2_Latch:
+ case GDK_ISO_Level3_Shift:
+ case GDK_ISO_Level3_Latch:
+ case GDK_ISO_Level3_Lock:
+ case GDK_ISO_Level5_Shift:
+ case GDK_ISO_Level5_Latch:
+ case GDK_ISO_Level5_Lock:
+ case GDK_ISO_Group_Shift:
+ case GDK_ISO_Group_Latch:
+ case GDK_ISO_Group_Lock:
+ case GDK_ISO_Next_Group:
+ case GDK_ISO_Next_Group_Lock:
+ case GDK_ISO_Prev_Group:
+ case GDK_ISO_Prev_Group_Lock:
+ case GDK_ISO_First_Group:
+ case GDK_ISO_First_Group_Lock:
+ case GDK_ISO_Last_Group:
+ case GDK_ISO_Last_Group_Lock:
+ return FALSE;
+ default:
+ return TRUE;
+ }
+}
+
+
+
+static gboolean
terminal_widget_key_press_event (GtkWidget *widget,
GdkEventKey *event)
{
@@ -614,6 +645,12 @@ terminal_widget_key_press_event (GtkWidget *widget,
"misc-shift-arrows-scroll", &shift_arrows_scroll,
NULL);
+ /* ignore keys that modify keyboard layout,
+ * in case user only presses them to reach
+ * a non-standard Up/Down/PageUp/PageDown */
+ if (!is_keystroke_keysym(event->keyval))
+ return TRUE;
+
/* popup context menu if "Menu" or "<Shift>F10" is pressed */
if (event->keyval == GDK_KEY_Menu ||
(!shortcuts_no_menukey && (event->state & GDK_SHIFT_MASK) != 0 && event->keyval == GDK_KEY_F10))
--
2.9.2
More information about the Xfce4-dev
mailing list