Make Escape key close More... modes before closing overlay entirely

This matches what I'd expect at least.
This commit is contained in:
Colin Walters 2009-03-06 13:06:39 -05:00
parent 3066f60efc
commit 8b1f732228

View File

@ -146,11 +146,18 @@ Sideshow.prototype = {
this._searchEntry.connect('key-press-event', function (se, e) {
let symbol = Shell.get_event_key_symbol(e);
if (symbol == Clutter.Escape) {
// A single escape clears the entry, two of them hides the overlay
if (me._searchEntry.text == '')
me.emit('activated');
else
// Escape will keep clearing things back to the desktop. First, if
// we have active text, we remove it.
if (me._searchEntry.text != '')
me._searchEntry.text = '';
// Next, if we're in one of the "more" modes, close it
else if (me._moreAppsMode)
me._unsetMoreAppsMode();
else if (me._moreDocsMode)
me._unsetMoreDocsMode();
else
// Finally, just close the overlay entirely
me.emit('activated');
return true;
} else if (symbol == Clutter.Up) {
// selectUp and selectDown wrap around in their respective displays