From 295ed0033e813796b73e8f5789ae7112d1302cb1 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Tue, 28 Feb 2012 15:36:32 -0500 Subject: 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 --- gtk/gtkcellrendereraccel.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'gtk/gtkcellrendereraccel.c') 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) -- cgit v1.2.1