From 1d782647513181b3206a7fcb2f3d323046f57091 Mon Sep 17 00:00:00 2001 From: Andrea Azzarone Date: Fri, 29 Jun 2012 20:21:19 +0200 Subject: Close the shortcut overlay if a key modifier has been pressed. (bzr r2455.3.1) --- plugins/unityshell/src/unityshell.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'plugins') diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 608a82b99..4bfdcd020 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -1401,6 +1401,21 @@ void UnityScreen::handleEvent(XEvent* event) break; case KeyPress: { + if (super_keypressed_) + { + /* We need an idle to postpone this action, after the current event + * has been processed */ + sources_.Add(std::make_shared([&]() { + if (!launcher_controller_->KeyNavIsActive()) + { + shortcut_controller_->SetEnabled(false); + shortcut_controller_->Hide(); + EnableCancelAction(CancelActionTarget::SHORTCUT_HINT, false); + } + return false; + })); + } + KeySym key_sym; char key_string[2]; int result = XLookupString(&(event->xkey), key_string, 2, &key_sym, 0); @@ -1428,21 +1443,6 @@ void UnityScreen::handleEvent(XEvent* event) if (super_keypressed_) { - if (key_sym != XK_Escape || (key_sym == XK_Escape && !launcher_controller_->KeyNavIsActive())) - { - /* We need an idle to postpone this action, after the current event - * has been processed */ - sources_.Add(std::make_shared([&]() { - if (!launcher_controller_->KeyNavIsActive()) - { - shortcut_controller_->SetEnabled(false); - shortcut_controller_->Hide(); - EnableCancelAction(CancelActionTarget::SHORTCUT_HINT, false); - } - return false; - })); - } - skip_other_plugins = launcher_controller_->HandleLauncherKeyEvent(screen->dpy(), key_sym, event->xkey.keycode, event->xkey.state, key_string); if (!skip_other_plugins) skip_other_plugins = dash_controller_->CheckShortcutActivation(key_string); -- cgit v1.2.3