summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/event.cpp12
-rw-r--r--src/window.cpp5
2 files changed, 9 insertions, 8 deletions
diff --git a/src/event.cpp b/src/event.cpp
index a41d7b8..5c0769d 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -1876,8 +1876,11 @@ CompScreen::handleEvent (XEvent *event)
state &= ~CompWindowStateDemandsAttentionMask;
w->changeState (state);
+
+ if (priv->nextActiveWindow == event->xfocus.window)
+ priv->nextActiveWindow = None;
}
- else
+ else if (event->xfocus.window == priv->root)
{
/* Don't ever let the focus go to the root
* window except in grab cases
@@ -1887,7 +1890,9 @@ CompScreen::handleEvent (XEvent *event)
* the other window managers should handle that
*/
- if (event->xfocus.window == priv->root)
+ if (event->xfocus.detail == NotifyDetailNone ||
+ (event->xfocus.mode == NotifyNormal &&
+ event->xfocus.detail == NotifyInferior))
{
priv->activeWindow = None;
@@ -1898,9 +1903,6 @@ CompScreen::handleEvent (XEvent *event)
screen->focusDefaultWindow ();
}
}
-
- if (priv->nextActiveWindow == event->xfocus.window)
- priv->nextActiveWindow = None;
}
}
else
diff --git a/src/window.cpp b/src/window.cpp
index f26f7cb..53fe4d8 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2014,9 +2014,8 @@ CompWindow::moveInputFocusTo ()
void
CompWindow::moveInputFocusToOtherWindow ()
{
- if ((priv->id = screen->activeWindow () ||
- priv->id == screen->priv->nextActiveWindow) ||
- screen->activeWindow () == None)
+ if (priv->id == screen->activeWindow () ||
+ priv->id == screen->priv->nextActiveWindow)
{
CompWindow *ancestor;