From 89c2611d0b9e956ddb437cf8a4155110da4903a1 Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Tue, 22 Mar 2011 16:46:56 +0800 Subject: Revert "If an unexpected window gets focus (e.g. by a client calling XSetInputFocus directly), make sure that moving the input focus to a default window still works when that window is closed." This reverts commit 1fb701594b78e950c031974d83c3566d1d648156. There are some problems created by this commit, reverting for now until they can be evauluated Conflicts: src/event.cpp --- src/event.cpp | 12 +++++++----- src/window.cpp | 5 ++--- 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; -- cgit v1.1