keybindings: filter overlay key even when not-modal

mutter currently only filters the overlay key through the shell
when there is a grab operation and that grab operation belongs to the
shell (because the shell is pushModal'd). This means the shell can't
filter out overlay key press events events at startup (since the shell
isn't normally modal).

This commit changes the code to always run the shell filtering code,
even when the shell is not modal.

https://bugzilla.gnome.org/show_bug.cgi?id=694837
This commit is contained in:
Ray Strode 2013-03-04 11:23:46 -05:00
parent 99cfbac473
commit 377e2ed8a5

View File

@ -1707,23 +1707,21 @@ process_overlay_key (MetaDisplay *display,
} }
else if (event->evtype == XI_KeyRelease) else if (event->evtype == XI_KeyRelease)
{ {
MetaKeyBinding *binding;
display->overlay_key_only_pressed = FALSE; display->overlay_key_only_pressed = FALSE;
/* We want to unfreeze events, but keep the grab so that if the user /* We want to unfreeze events, but keep the grab so that if the user
* starts typing into the overlay we get all the keys */ * starts typing into the overlay we get all the keys */
XIAllowEvents (display->xdisplay, event->deviceid, XIAllowEvents (display->xdisplay, event->deviceid,
XIAsyncDevice, event->time); XIAsyncDevice, event->time);
if (display->grab_op == META_GRAB_OP_COMPOSITOR) binding = display_get_keybinding (display,
{ display->overlay_key_combo.keysym,
MetaKeyBinding *binding = display->overlay_key_combo.keycode,
display_get_keybinding (display, display->grab_mask);
display->overlay_key_combo.keysym, if (binding &&
display->overlay_key_combo.keycode, meta_compositor_filter_keybinding (display->compositor, screen, binding))
display->grab_mask); return TRUE;
if (binding &&
meta_compositor_filter_keybinding (display->compositor, screen, binding))
return TRUE;
}
meta_display_overlay_key_activate (display); meta_display_overlay_key_activate (display);
} }