From 6c598fa9d14bfa26bd6fd41a23cf8630747064fc Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 5 Oct 2016 16:56:42 +0200 Subject: [PATCH] keyboard: Fix capture of Alt+PrintScreen shortcuts Alt+PrintScreen gives you Alt+SysRq. Repair the key value to match user expectations instead. https://bugzilla.gnome.org/show_bug.cgi?id=772050 --- panels/keyboard/cc-keyboard-shortcut-editor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panels/keyboard/cc-keyboard-shortcut-editor.c b/panels/keyboard/cc-keyboard-shortcut-editor.c index e44234355..cb9e5f619 100644 --- a/panels/keyboard/cc-keyboard-shortcut-editor.c +++ b/panels/keyboard/cc-keyboard-shortcut-editor.c @@ -654,6 +654,14 @@ cc_keyboard_shortcut_editor_key_press_event (GtkWidget *widget, if (keyval_lower != event->keyval) real_mask |= GDK_SHIFT_MASK; + if (keyval_lower == GDK_KEY_Sys_Req && + (real_mask & GDK_MOD1_MASK) != 0) + { + /* HACK: we don't want to use SysRq as a keybinding (but we do + * want Alt+Print), so we avoid translation from Alt+Print to SysRq */ + keyval_lower = GDK_KEY_Print; + } + /* A single Escape press cancels the editing */ if (!event->is_modifier && real_mask == 0 && keyval_lower == GDK_KEY_Escape) {