From 8b1f7322286d1d6a9911ffd1d5d41cface579e62 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 6 Mar 2009 13:06:39 -0500 Subject: [PATCH] Make Escape key close More... modes before closing overlay entirely This matches what I'd expect at least. --- js/ui/overlay.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/ui/overlay.js b/js/ui/overlay.js index 2cb3aa3d0..ce1294a7a 100644 --- a/js/ui/overlay.js +++ b/js/ui/overlay.js @@ -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