summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--staticswitcher.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/staticswitcher.c b/staticswitcher.c
index 1b3c585..9143ade 100644
--- a/staticswitcher.c
+++ b/staticswitcher.c
@@ -474,7 +474,7 @@ switchToWindow (CompScreen *s,
}
ss->selectedWindow = w;
- moveInputFocusToWindow (w);
+ s->display->activeWindow = w->id;
if (old != w)
{
@@ -760,20 +760,11 @@ switchTerminate (CompDisplay *d,
}
ss->switching = FALSE;
+ d->activeWindow = sd->lastActiveWindow;
- if (state & CompActionStateCancel)
- {
- ss->selectedWindow = NULL;
- if (d->activeWindow != sd->lastActiveWindow)
- {
- w = findWindowAtDisplay (d, sd->lastActiveWindow);
- if (w)
- moveInputFocusToWindow (w);
- }
- }
-
- if (state && ss->selectedWindow && !ss->selectedWindow->destroyed)
- sendWindowActivationRequest (s, ss->selectedWindow->id);
+ if (state && !(state & CompActionStateCancel))
+ if (ss->selectedWindow && !ss->selectedWindow->destroyed)
+ sendWindowActivationRequest (s, ss->selectedWindow->id);
removeScreenGrab (s, ss->grabIndex, 0);
ss->grabIndex = 0;