main: hide the overview on key release

Entering the overview with the overlay key is done on key release but
exiting the overview on key press, which is inconsistent.

This change makes the overview hidden also on key release.

https://bugzilla.gnome.org/show_bug.cgi?id=683024
This commit is contained in:
Stéphane Démurget 2012-11-04 18:30:44 +01:00
parent 73b4a0ef5f
commit 6e4c89b310

View File

@ -473,7 +473,7 @@ function getWindowActorsForWorkspace(workspaceIndex) {
function _globalKeyPressHandler(actor, event) {
if (modalCount == 0)
return false;
if (event.type() != Clutter.EventType.KEY_PRESS)
if (event.type() != Clutter.EventType.KEY_PRESS && event.type() != Clutter.EventType.KEY_RELEASE)
return false;
if (!sessionMode.allowKeybindingsWhenModal) {
@ -489,6 +489,7 @@ function _globalKeyPressHandler(actor, event) {
// This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
let action = global.display.get_keybinding_action(keyCode, modifierState);
if (event.type() == Clutter.EventType.KEY_PRESS) {
if (action == Meta.KeyBindingAction.SWITCH_PANELS) {
ctrlAltTabManager.popup(modifierState & Clutter.ModifierType.SHIFT_MASK,
modifierState);
@ -531,10 +532,15 @@ function _globalKeyPressHandler(actor, event) {
openRunDialog();
return true;
case Meta.KeyBindingAction.PANEL_MAIN_MENU:
case Meta.KeyBindingAction.OVERLAY_KEY:
overview.hide();
return true;
}
} else if (event.type() == Clutter.EventType.KEY_RELEASE) {
if (action == Meta.KeyBindingAction.OVERLAY_KEY) {
overview.hide();
return true;
}
}
return false;
}