summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorAndrea Azzarone <azzaronea@gmail.com>2012-06-29 20:21:19 +0200
committerAndrea Azzarone <azzaronea@gmail.com>2012-06-29 20:21:19 +0200
commit1d782647513181b3206a7fcb2f3d323046f57091 (patch)
tree4d2eb9e7396554e8cdc197cbffdd675e3f720bb8 /plugins
parentbbf067650a9c18fcee5265fa7d53f5d9a2cd2757 (diff)
Close the shortcut overlay if a key modifier has been pressed.
(bzr r2455.3.1)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp30
1 files changed, 15 insertions, 15 deletions
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<glib::Idle>([&]() {
+ 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<glib::Idle>([&]() {
- 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);