diff options
author | Michael Cardell Widerkrantz <mc@hack.org> | 2011-06-04 15:47:02 +0200 |
---|---|---|
committer | Michael Cardell Widerkrantz <mc@hack.org> | 2011-06-04 15:47:02 +0200 |
commit | 9f0fa0845bd7ea80920a99b2a30eb697396403a1 (patch) | |
tree | 81c76e23a93633fea3cca93a210944bd832e6943 | |
parent | 851e69a1ae038270ed843d83b55392821f360967 (diff) | |
download | mcwm-9f0fa0845bd7ea80920a99b2a30eb697396403a1.zip |
Take output coordinates into consideration when resizing with limits.
-rw-r--r-- | mcwm.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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; |