[Xfce4-commits] <libxfce4ui:master> Fix alt + print being detected as SysReq (bug #7897).
Jérôme Guelfucci
noreply at xfce.org
Sun Dec 30 15:42:07 CET 2012
Updating branch refs/heads/master
to 0d2c165aeff3da0268276cbc75f9470bfc349e4b (commit)
from 927438b9ce57253d705a846725892935d02f9f1f (commit)
commit 0d2c165aeff3da0268276cbc75f9470bfc349e4b
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