summaryrefslogtreecommitdiff
path: root/plugins/resize/src/resize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/resize/src/resize.cpp')
-rw-r--r--plugins/resize/src/resize.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/plugins/resize/src/resize.cpp b/plugins/resize/src/resize.cpp
index 8cab482..a2b3bb8 100644
--- a/plugins/resize/src/resize.cpp
+++ b/plugins/resize/src/resize.cpp
@@ -258,14 +258,14 @@ getPointForTp (unsigned int tp, unsigned int output, int &op, int &wap)
* */
static int
-getOutputForEdge (int windowOutput, unsigned int touch)
+getOutputForEdge (int windowOutput, unsigned int touch, bool skipFirst)
{
int op, wap;
- int ret = 0;
+ int ret = windowOutput;
getPointForTp (touch, windowOutput, op, wap);
- if (op == wap)
+ if ((op == wap) || skipFirst)
{
int co = windowOutput;
@@ -273,8 +273,6 @@ getOutputForEdge (int windowOutput, unsigned int touch)
{
int oco = co;
- getPointForTp (touch, co, op, wap);
-
co = findTouchingOutput (op, touch);
/* Could not find a leftmost output from here
@@ -286,6 +284,8 @@ getOutputForEdge (int windowOutput, unsigned int touch)
break;
}
+ getPointForTp (touch, co, op, wap);
+
/* There is something in the way here.... */
if (op != wap)
{
@@ -296,6 +296,8 @@ getOutputForEdge (int windowOutput, unsigned int touch)
while (co != -1);
}
+ fprintf (stderr, "constraining to %i\n", ret);
+
return ret;
}
@@ -473,6 +475,14 @@ resizeInitiate (CompAction *action,
{
int output = w->outputDevice ();
int lco, tco, bco, rco;
+ bool sl = screen->outputDevs ().at (output).workArea ().left () >
+ w->serverGeometry ().left ();
+ bool sr = screen->outputDevs ().at (output).workArea ().right () <
+ w->serverGeometry ().right ();
+ bool st = screen->outputDevs ().at (output).workArea ().top () >
+ w->serverGeometry ().top ();
+ bool sb = screen->outputDevs ().at (output).workArea ().bottom () <
+ w->serverGeometry ().bottom ();
lco = tco = bco = rco = output;
@@ -481,10 +491,10 @@ resizeInitiate (CompAction *action,
and not with a key (e.g. alt+button) */
rs->offWorkAreaConstrained = true;
- tco = getOutputForEdge (output, TOUCH_BOTTOM);
- bco = getOutputForEdge (output, TOUCH_TOP);
- lco = getOutputForEdge (output, TOUCH_LEFT);
- rco = getOutputForEdge (output, TOUCH_TOP);
+ lco = getOutputForEdge (output, TOUCH_RIGHT, sl);
+ rco = getOutputForEdge (output, TOUCH_LEFT, sr);
+ tco = getOutputForEdge (output, TOUCH_BOTTOM, st);
+ bco = getOutputForEdge (output, TOUCH_TOP, sb);
/* Now we need to form one big rect which describes
* the available workarea */