[gnome-control-center/gnome-3-22] keyboard: Fix capture of Alt+PrintScreen shortcuts



commit deb7dcbeed9219732aabb5770b244b6a7bb1ce45
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 5 16:56:42 2016 +0200

    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 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-shortcut-editor.c b/panels/keyboard/cc-keyboard-shortcut-editor.c
index e442343..cb9e5f6 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)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]