summaryrefslogtreecommitdiff
path: root/plugins/switcher
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-09-08 19:27:53 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-09-08 19:27:53 +0800
commit1b2b54feb3dc2caa141fbe275ca6de1ae6ea4ad5 (patch)
tree94ef5b0d97c610b2846d71d72d3baf33f2c6c8e4 /plugins/switcher
parent5be9ced1e10caa39c768c2952bde032dffd30399 (diff)
downloadcompiz-with-glib-mainloop-1b2b54feb3dc2caa141fbe275ca6de1ae6ea4ad5.tar.gz
compiz-with-glib-mainloop-1b2b54feb3dc2caa141fbe275ca6de1ae6ea4ad5.tar.bz2
compiztoolbox.cpp: Move input focus to highlighted windows so it is possible to alt-f4 them
switcher.cpp: Move input focus back to last active window if switcher action is cancelled
Diffstat (limited to 'plugins/switcher')
-rw-r--r--plugins/switcher/src/switcher.cpp10
-rw-r--r--plugins/switcher/src/switcher.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/plugins/switcher/src/switcher.cpp b/plugins/switcher/src/switcher.cpp
index 6467fe1..58fe35b 100644
--- a/plugins/switcher/src/switcher.cpp
+++ b/plugins/switcher/src/switcher.cpp
@@ -313,6 +313,7 @@ SwitchScreen::initiate (SwitchWindowSelection selection,
setSelectedWindowHint ();
}
+ lastActiveWindow = screen->activeWindow ();
activateEvent (true);
}
@@ -379,6 +380,14 @@ switchTerminate (CompAction *action,
{
ss->selectedWindow = NULL;
ss->zoomedWindow = NULL;
+
+ if (screen->activeWindow () != ss->lastActiveWindow)
+ {
+ CompWindow *w = screen->findWindow (ss->lastActiveWindow);
+
+ if (w)
+ w->moveInputFocusTo ();
+ }
}
if (state && ss->selectedWindow && !ss->selectedWindow->destroyed ())
@@ -1091,6 +1100,7 @@ SwitchScreen::setZoom ()
SwitchScreen::SwitchScreen (CompScreen *screen) :
BaseSwitchScreen (screen),
PluginClassHandler<SwitchScreen,CompScreen> (screen),
+ lastActiveWindow (None),
zoomedWindow (NULL),
switching (false),
zoomMask (~0),
diff --git a/plugins/switcher/src/switcher.h b/plugins/switcher/src/switcher.h
index 91eaad0..dee22d2 100644
--- a/plugins/switcher/src/switcher.h
+++ b/plugins/switcher/src/switcher.h
@@ -76,6 +76,8 @@ class SwitchScreen :
void windowRemove (CompWindow *w);
bool adjustVelocity ();
+
+ Window lastActiveWindow;
CompWindow *zoomedWindow;