summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrendereraccel.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-02-28 15:36:32 -0500
committerMatthias Clasen <mclasen@redhat.com>2012-03-22 00:45:08 -0400
commit295ed0033e813796b73e8f5789ae7112d1302cb1 (patch)
treefe1a39e3cadb44674e583ac4df69e3456f41be5d /gtk/gtkcellrendereraccel.c
parent909fe122820e05cd0bd7b272d89d00ad062f30cf (diff)
downloadgtk+-295ed0033e813796b73e8f5789ae7112d1302cb1.tar.gz
cellrendereraccel: 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
Diffstat (limited to 'gtk/gtkcellrendereraccel.c')
-rw-r--r--gtk/gtkcellrendereraccel.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index 10758f6b55..385c5612c5 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -452,12 +452,24 @@ grab_key_callback (GtkWidget *widget,
accel_mods = event->state;
- _gtk_translate_keyboard_accel_state (gdk_keymap_get_for_display (display),
- event->hardware_keycode,
- event->state,
- gtk_accelerator_get_default_mod_mask (),
- event->group,
- &keyval, NULL, NULL, &consumed_modifiers);
+ if (event->keyval == GDK_KEY_Sys_Req &&
+ (accel_mods & 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 = GDK_KEY_Print;
+ consumed_modifiers = 0;
+ }
+ else
+ {
+ _gtk_translate_keyboard_accel_state (gdk_keymap_get_for_display (display),
+ event->hardware_keycode,
+ event->state,
+ gtk_accelerator_get_default_mod_mask (),
+ event->group,
+ &keyval, NULL, NULL, &consumed_modifiers);
+ }
accel_key = gdk_keyval_to_lower (keyval);
if (accel_key == GDK_KEY_ISO_Left_Tab)