diff options
author | Danny Baumann <dannybaumann@web.de> | 2009-01-07 08:37:42 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2009-01-10 10:51:06 +0100 |
commit | 8efce6eb377a8c93677ac21a85427f48c22fe6bc (patch) | |
tree | 32c06ce9329dd0cc56975108bb4f4d5d89d39046 | |
parent | 4595dac09ae5809ac854da4e34320b2a918e542d (diff) |
Only clip struts to output devices they're visible on.
-rw-r--r-- | src/window.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c index f3c88d04..3bc70027 100644 --- a/src/window.c +++ b/src/window.c @@ -1894,8 +1894,11 @@ updateWindowStruts (CompWindow *w) strutX1 = new.left.x; strutX2 = strutX1 + new.left.width; + strutY1 = new.left.y; + strutY2 = strutY1 + new.left.height; - if (strutX2 > x1 && strutX2 <= x2) + if (strutX2 > x1 && strutX2 <= x2 && + strutY1 <= y2 && strutY2 >= y1) { new.left.x = x1; new.left.width = strutX2 - x1; @@ -1903,26 +1906,35 @@ updateWindowStruts (CompWindow *w) strutX1 = new.right.x; strutX2 = strutX1 + new.right.width; + strutY1 = new.right.y; + strutY2 = strutY1 + new.right.height; - if (strutX1 > x1 && strutX1 <= x2) + if (strutX1 > x1 && strutX1 <= x2 && + strutY1 <= y2 && strutY2 >= y1) { new.right.x = strutX1; new.right.width = x2 - strutX1; } + strutX1 = new.top.x; + strutX2 = strutX1 + new.top.width; strutY1 = new.top.y; strutY2 = strutY1 + new.top.height; - if (strutY2 > y1 && strutY2 <= y2) + if (strutX1 <= x2 && strutX2 >= x1 && + strutY2 > y1 && strutY2 <= y2) { new.top.y = y1; new.top.height = strutY2 - y1; } + strutX1 = new.bottom.x; + strutX2 = strutX1 + new.bottom.width; strutY1 = new.bottom.y; strutY2 = strutY1 + new.bottom.height; - if (strutY1 > y1 && strutY1 <= y2) + if (strutX1 <= x2 && strutX2 >= x1 && + strutY1 > y1 && strutY1 <= y2) { new.bottom.y = strutY1; new.bottom.height = y2 - strutY1; |