summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2011-06-04 15:47:02 +0200
committerMichael Cardell Widerkrantz <mc@hack.org>2011-06-04 15:47:02 +0200
commit9f0fa0845bd7ea80920a99b2a30eb697396403a1 (patch)
tree81c76e23a93633fea3cca93a210944bd832e6943
parent851e69a1ae038270ed843d83b55392821f360967 (diff)
downloadmcwm-9f0fa0845bd7ea80920a99b2a30eb697396403a1.zip
Take output coordinates into consideration when resizing with limits.
-rw-r--r--mcwm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mcwm.c b/mcwm.c
index 7282514..20636bc 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -2191,14 +2191,14 @@ void resizelim(struct client *client)
client->width = client->min_width;
}
- if (client->x + client->width > mon_width)
+ if (client->x + client->width + BORDERWIDTH * 2 > mon_x + mon_width)
{
- client->width = mon_width - (client->x + BORDERWIDTH * 2);
+ client->width = mon_width - ((client->x - mon_x) + BORDERWIDTH * 2);
}
-
- if (client->y + client->height > mon_height)
+
+ if (client->y + client->height + BORDERWIDTH * 2 > mon_y + mon_height)
{
- client->height = mon_height - (client->y + BORDERWIDTH * 2);
+ client->height = mon_height - ((client->y - mon_y) + BORDERWIDTH * 2);
}
resize(client->id, client->width, client->height);
@@ -2214,6 +2214,8 @@ void resize(xcb_drawable_t win, uint16_t width, uint16_t height)
/* Can't resize root. */
return;
}
+
+ PDEBUG("Resizing to %d x %d.\n", width, height);
values[0] = width;
values[1] = height;