summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-03-22 16:46:56 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-03-22 16:46:56 +0800
commit89c2611d0b9e956ddb437cf8a4155110da4903a1 (patch)
treec96d49e4db26d04843082adda43b8e9b01759d77 /src
parentf6921b6f06b27c48437a439b91ddd96f2ec8395b (diff)
downloadmobilebling-89c2611d0b9e956ddb437cf8a4155110da4903a1.tar.gz
mobilebling-89c2611d0b9e956ddb437cf8a4155110da4903a1.tar.bz2
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
Diffstat (limited to 'src')
-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;