summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-02-11 10:52:43 +0100
committerDanny Baumann <dannybaumann@web.de>2008-02-11 10:52:43 +0100
commite5f3d7a0ec017cbb6943fc1cb2d83401e3fbbc08 (patch)
treee43d9abcf4db60d41331156e57266093a4223973
parent92bceeb449b0564831b8b679b9d4f6a8fd735233 (diff)
downloadput-e5f3d7a0ec017cbb6943fc1cb2d83401e3fbbc08.tar.gz
put-e5f3d7a0ec017cbb6943fc1cb2d83401e3fbbc08.tar.bz2
Don't apply "Avoid offscreen" to full viewport movements.
-rw-r--r--put.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/put.c b/put.c
index e01ccfa..7b0d43f 100644
--- a/put.c
+++ b/put.c
@@ -574,7 +574,6 @@ putInitiateCommon (CompDisplay *d,
if (XQueryPointer (d->display, w->id, &root, &child,
&rx, &ry, &winX, &winY, &pMask))
{
-
if (putGetWindowCenter (s))
{
/* window center */
@@ -626,29 +625,41 @@ putInitiateCommon (CompDisplay *d,
{
if (putGetAvoidOffscreen (s))
{
- /* avoids window borders offscreen */
- if ((-(x - hx) + w->input.left + putGetPadLeft (s)) > dx)
+ /* avoids window borders offscreen, but allow full
+ viewport movements */
+ int inDx, dxBefore;
+ int inDy, dyBefore;
+
+ inDx = dxBefore = dx % s->width;
+ inDy = dyBefore = dy % s->height;
+
+ if ((-(x - hx) + w->input.left + putGetPadLeft (s)) > inDx)
{
- dx = -(x - hx) + w->input.left + putGetPadLeft (s);
+ inDx = -(x - hx) + w->input.left + putGetPadLeft (s);
}
- else if ((width - w->width - (x - hx) -
- w->input.right - putGetPadRight (s)) < dx)
+ else if ((width - w->width - (x - hx) -
+ w->input.right - putGetPadRight (s)) < inDx)
{
- dx = width - w->width - (x - hx) -
- w->input.right - putGetPadRight (s);
+ inDx = width - w->width - (x - hx) -
+ w->input.right - putGetPadRight (s);
}
- if ((-(y - hy) + w->input.top + putGetPadTop (s)) > dy)
+ if ((-(y - hy) + w->input.top + putGetPadTop (s)) > inDy)
{
- dy = -(y - hy) + w->input.top + putGetPadTop (s);
+ inDy = -(y - hy) + w->input.top + putGetPadTop (s);
}
- else if ((height - w->height - (y - hy) - w->input.bottom -
- putGetPadBottom (s)) < dy)
+ else if ((height - w->height - (y - hy) - w->input.bottom -
+ putGetPadBottom (s)) < inDy)
{
- dy = height - w->height - (y - hy) -
- w->input.bottom - putGetPadBottom (s);
+ inDy = height - w->height - (y - hy) -
+ w->input.bottom - putGetPadBottom (s);
}
+
+ /* apply the change */
+ dx += inDx - dxBefore;
+ dy += inDy - dyBefore;
}
+
/* save the windows position in the saveMask
* this is used when unmaximizing the window
*/