summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp22
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)
{