[Xfce4-commits] <libxfce4ui:jeromeg/keyboard-shortcuts> Fix alt + print being detected as SysReq (bug #7897).

Jérôme Guelfucci noreply at xfce.org
Fri Dec 28 15:54:10 CET 2012


Updating branch refs/heads/jeromeg/keyboard-shortcuts
         to 597d9f694ff4d1f8420544936095b92ef1c9873e (commit)
       from 441e8ed5fbe31cab23f76ab8872d423d822b02ae (commit)

commit 597d9f694ff4d1f8420544936095b92ef1c9873e
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Tue Dec 18 10:00:42 2012 +0100

    Fix alt + print being detected as SysReq (bug #7897).
    
    If we were able to grab it, it means that this combination is not used
    as SysReq, users should then be able to use that.
    
    Note that this won't work by default on most distributions because the
    SysReq key is enabled and X won't pass the event. You need to disable the
    SysReq key, for example by setting "kernel.sysrq = 0" in /etc/sysctl.conf.

 libxfce4kbd-private/xfce-shortcut-dialog.c   |    7 +++++++
 libxfce4kbd-private/xfce-shortcuts-grabber.c |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libxfce4kbd-private/xfce-shortcut-dialog.c b/libxfce4kbd-private/xfce-shortcut-dialog.c
index 2ee1931..38e53ea 100644
--- a/libxfce4kbd-private/xfce-shortcut-dialog.c
+++ b/libxfce4kbd-private/xfce-shortcut-dialog.c
@@ -370,6 +370,13 @@ xfce_shortcut_dialog_key_pressed (XfceShortcutDialog *dialog,
                                        modifiers, event->group,
                                        &keyval, NULL, NULL, &consumed);
 
+  /* We want Alt + Print to be Alt + Print not SysReq. See bug #7897 */
+  if (keyval == GDK_KEY_Sys_Req && (modifiers & GDK_MOD1_MASK) != 0)
+    {
+      consumed = 0;
+      keyval = GDK_KEY_Print;
+    }
+
   /* Get the modifiers */
 
   /* If Shift was used when translating the keyboard state, we remove it
diff --git a/libxfce4kbd-private/xfce-shortcuts-grabber.c b/libxfce4kbd-private/xfce-shortcuts-grabber.c
index 7f194f2..31585b5 100644
--- a/libxfce4kbd-private/xfce-shortcuts-grabber.c
+++ b/libxfce4kbd-private/xfce-shortcuts-grabber.c
@@ -497,6 +497,13 @@ xfce_shortcuts_grabber_event_filter (GdkXEvent            *gdk_xevent,
                                        XkbGroupForCoreState (xevent->xkey.state),
                                        &keyval, NULL, NULL, &consumed);
 
+  /* We want Alt + Print to be Alt + Print not SysReq. See bug #7897 */
+  if (keyval == GDK_KEY_Sys_Req && (modifiers & GDK_MOD1_MASK) != 0)
+    {
+      consumed = 0;
+      keyval = GDK_KEY_Print;
+    }
+
   /* Get the modifiers */
 
   /* If Shift was used when translating the keyboard state, we remove it


More information about the Xfce4-commits mailing list