diff options
-rw-r--r-- | src/window.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp index efc97ce..f06e2ec 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1722,8 +1722,30 @@ CompWindow::ungrabNotify () void CompWindow::stateChangeNotify (unsigned int lastState) +{ WRAPABLE_HND_FUNC (11, stateChangeNotify, lastState); + /* if being made sticky */ + if (!(lastState & CompWindowStateStickyMask) && + (priv->state & CompWindowStateStickyMask)) + { + CompPoint vp; /* index of the window's vp */ + + /* Find which viewport the window falls in, + and check if it's the current viewport */ + vp = defaultViewport (); + if (screen->vp () != vp) + { + int moveX = (screen->vp ().x () - vp.x ()) * screen->width (); + int moveY = (screen->vp ().y () - vp.y ()) * screen->height (); + + move (moveX, moveY, TRUE); + syncPosition (); + } + } +} + + bool PrivateWindow::isGroupTransient (Window clientLeader) { |