summaryrefslogtreecommitdiff
path: root/src/staticswitcher.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-09-08 19:27:26 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-09-08 19:27:26 +0800
commit1c3f92468b64fe445280a1b3f730e1de47819795 (patch)
tree595a96fbb1a2c377b054e0979bc9275de158ec8b /src/staticswitcher.cpp
parentc69d8f22135d0e053f7c10028e2585109b3e4d74 (diff)
downloadstaticswitcher-1c3f92468b64fe445280a1b3f730e1de47819795.tar.gz
staticswitcher-1c3f92468b64fe445280a1b3f730e1de47819795.tar.bz2
Return input focus to last active window if switcher is cancelled
Diffstat (limited to 'src/staticswitcher.cpp')
-rw-r--r--src/staticswitcher.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/staticswitcher.cpp b/src/staticswitcher.cpp
index 31370ec..182cf4d 100644
--- a/src/staticswitcher.cpp
+++ b/src/staticswitcher.cpp
@@ -2,7 +2,7 @@
*
* Compiz application switcher plugin
*
- * staticswitcher.c
+ * staticswitcher.cpp
*
* Copyright : (C) 2008 by Danny Baumann
* E-mail : maniac@compiz-fusion.org
@@ -371,6 +371,7 @@ StaticSwitchScreen::initiate (SwitchWindowSelection selection,
setSelectedWindowHint ();
}
+ lastActiveWindow = screen->activeWindow ();
activateEvent (true);
}
@@ -447,6 +448,14 @@ switchTerminate (CompAction *action,
::screen->handleEventSetEnabled (ss, false);
ss->selectedWindow = NULL;
+
+ if (screen->activeWindow () != ss->lastActiveWindow)
+ {
+ CompWindow *w = screen->findWindow (ss->lastActiveWindow);
+
+ if (w)
+ w->moveInputFocusTo ();
+ }
ss->setSelectedWindowHint ();