[Xfce4-commits] <libxfce4ui:xfce-4.10> Fix alt + print being detected as SysReq (bug #7897).
Jérôme Guelfucci
noreply at xfce.org
Sat May 4 12:10:05 CEST 2013
Updating branch refs/heads/xfce-4.10
to 06ca1a8bf92cb6d7656dc28a1711b91bfac1080f (commit)
from 8733e8a022c3c9c700dbd9cabfb39051ae6fbf81 (commit)
commit 06ca1a8bf92cb6d7656dc28a1711b91bfac1080f
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 feb7a21..2052bf0 100644
--- a/libxfce4kbd-private/xfce-shortcut-dialog.c
+++ b/libxfce4kbd-private/xfce-shortcut-dialog.c
@@ -326,6 +326,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 1a9bccf..0118a70 100644
--- a/libxfce4kbd-private/xfce-shortcuts-grabber.c
+++ b/libxfce4kbd-private/xfce-shortcuts-grabber.c
@@ -494,6 +494,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