[gnome-settings-daemon] common: don't translate Alt+Print to SysRq
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: don't translate Alt+Print to SysRq
- Date: Wed, 29 Feb 2012 10:39:35 +0000 (UTC)
commit 7ae5c6e6142a3b44a7d607eea531f9a0c6fdd003
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Feb 28 15:32:33 2012 -0500
common: don't translate Alt+Print to SysRq
We want to use Alt+Print for screenshot keybindings, so we have to avoid
translating it into SysRq, since that's what the keymap would dictate.
After talking with Owen, it sounds like doing this generically would be
a lot of work and quite hairy code, so hardcoding this should be OK.
https://bugzilla.gnome.org/show_bug.cgi?id=671006
plugins/common/gsd-keygrab.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/common/gsd-keygrab.c b/plugins/common/gsd-keygrab.c
index c8c2e80..f8432cd 100644
--- a/plugins/common/gsd-keygrab.c
+++ b/plugins/common/gsd-keygrab.c
@@ -312,6 +312,14 @@ match_xi2_key (Key *key, XIDeviceEvent *event)
guint lower, upper;
guint mask;
+ /* HACK: we don't want to use SysRq as a keybinding, so we avoid
+ * its translation from Alt+Print. */
+ if (keyval == GDK_KEY_Sys_Req &&
+ (state & GDK_MOD1_MASK) != 0) {
+ consumed = 0;
+ keyval = GDK_KEY_Print;
+ }
+
/* The Key structure contains virtual modifiers, whereas
* the XEvent will be using the real modifier, so translate those */
mask = key->state;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]