summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-02-03 00:40:09 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-02-03 00:40:09 +0800
commit946f55f16f479c45f28f7f2643447ff4cdd42e06 (patch)
treee048103579e91935287f30b3ec115471ebac8408 /src/window.cpp
parent2cd108217d05f4edb9a1b661280cadcd3d5f9c35 (diff)
downloadunity-window-decorator-946f55f16f479c45f28f7f2643447ff4cdd42e06.tar.gz
unity-window-decorator-946f55f16f479c45f28f7f2643447ff4cdd42e06.tar.bz2
Fix lost window by bringing window made sticky to current viewport.
Forward port of 4bc44131442e9dbefadcad1a46932aec44bbcada to master
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)
{