summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2010-12-03 19:19:13 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2010-12-03 19:19:13 +0800
commit56b97b9076660d66de510af32e2b58a0b6dc70b2 (patch)
treecf783e1876c43ccad8a757af750d0671ed52d894 /src
parent80b1c0188a45eccf20536848a9457d08423ceb0c (diff)
parent4a5ec2bbc9a8024d294c90687a16b1ac39832170 (diff)
downloadcompiz-with-glib-mainloop-56b97b9076660d66de510af32e2b58a0b6dc70b2.tar.gz
compiz-with-glib-mainloop-56b97b9076660d66de510af32e2b58a0b6dc70b2.tar.bz2
Merge branch 'master' of git://git.compiz.org/compiz/core into glibmm-experimental
Diffstat (limited to 'src')
-rw-r--r--src/event.cpp4
-rw-r--r--src/privatescreen.h1
-rw-r--r--src/privatewindow.h1
-rw-r--r--src/window.cpp17
4 files changed, 21 insertions, 2 deletions
diff --git a/src/event.cpp b/src/event.cpp
index 6acf04f..4d7a2c6 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -1086,6 +1086,7 @@ CompScreen::handleEvent (XEvent *event)
w->priv->placed = false;
w->priv->managed = false;
+ w->priv->unmanaging = true;
if (w->priv->frame)
{
w->priv->unreparent ();
@@ -1660,6 +1661,9 @@ CompScreen::handleEvent (XEvent *event)
state &= ~CompWindowStateDemandsAttentionMask;
w->changeState (state);
+
+ if (priv->nextActiveWindow == event->xfocus.window)
+ priv->nextActiveWindow = None;
}
}
else
diff --git a/src/privatescreen.h b/src/privatescreen.h
index 725c43d..0f03d83 100644
--- a/src/privatescreen.h
+++ b/src/privatescreen.h
@@ -390,6 +390,7 @@ class PrivateScreen : public CoreOptions {
CompTimer pingTimer;
Window activeWindow;
+ Window nextActiveWindow;
Window below;
char displayString[256];
diff --git a/src/privatewindow.h b/src/privatewindow.h
index 8413691..59521be 100644
--- a/src/privatewindow.h
+++ b/src/privatewindow.h
@@ -239,6 +239,7 @@ class PrivateWindow {
bool invisible;
bool destroyed;
bool managed;
+ bool unmanaging;
int destroyRefCnt;
int unmapRefCnt;
diff --git a/src/window.cpp b/src/window.cpp
index d5997b4..dd8d24d 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1718,12 +1718,15 @@ CompWindow::focus ()
if (overrideRedirect ())
return false;
- if (!priv->managed)
+ if (!priv->managed || priv->unmanaging)
return false;
if (!onCurrentDesktop ())
return false;
+ if (priv->destroyed)
+ return false;
+
if (!priv->shaded && (priv->state & CompWindowStateHiddenMask))
return false;
@@ -1937,6 +1940,9 @@ CompWindow::moveInputFocusTo ()
setFocus = true;
}
+ if (setFocus)
+ screen->priv->nextActiveWindow = priv->id;
+
if (!setFocus && !modalTransient)
{
CompWindow *ancestor;
@@ -1958,7 +1964,8 @@ CompWindow::moveInputFocusTo ()
void
CompWindow::moveInputFocusToOtherWindow ()
{
- if (priv->id == screen->activeWindow ())
+ if (priv->id == screen->activeWindow () ||
+ priv->id == screen->priv->nextActiveWindow)
{
CompWindow *ancestor;
@@ -4425,6 +4432,10 @@ bool
WindowInterface::isFocussable ()
WRAPABLE_DEF (isFocussable);
+bool
+WindowInterface::managed ()
+ WRAPABLE_DEF (managed);
+
Window
CompWindow::id ()
{
@@ -4652,6 +4663,7 @@ CompWindow::setShowDesktopMode (bool value)
bool
CompWindow::managed ()
{
+ WRAPABLE_HND_FUNC_RETURN (18, bool, managed);
return priv->managed;
}
@@ -5228,6 +5240,7 @@ PrivateWindow::PrivateWindow (CompWindow *window) :
invisible (true),
destroyed (false),
managed (false),
+ unmanaging (false),
destroyRefCnt (1),
unmapRefCnt (1),