summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-04-01 09:47:04 +0000
committersabetts <sabetts>2001-04-01 09:47:04 +0000
commitfb48f797f8bee3990d169c77c74de9c0e0fd80d0 (patch)
treee5a054807e8a144a0f2129f1531e92aaff28c828 /src
parent299d16aa6ae37bd73ae92ee8a5d1c6715682ee35 (diff)
downloadratpoison-fb48f797f8bee3990d169c77c74de9c0e0fd80d0.zip
(maximize_normal): fixed maximizing problems for
windows with resize hints. (maximize_transient): likewise
Diffstat (limited to 'src')
-rw-r--r--src/manage.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/manage.c b/src/manage.c
index e8b1b06..afa4730 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -312,17 +312,18 @@ maximize_transient (rp_window *win)
if (win->hints->flags & PResizeInc)
{
int amount;
+ int delta;
amount = maxx - win->width;
- amount -= amount % win->hints->width_inc;
- if (amount < 0) amount -= win->hints->width_inc;
- PRINT_DEBUG ("amount x: %d\n", amount);
+ delta = amount % win->hints->width_inc;
+ amount -= delta;
+ if (amount < 0 && delta) amount -= win->hints->width_inc;
maxx = amount + win->width;
amount = maxy - win->height;
- amount -= amount % win->hints->height_inc;
- if (amount < 0) amount -= win->hints->height_inc;
- PRINT_DEBUG ("amount y: %d\n", amount);
+ delta = amount % win->hints->height_inc;
+ amount -= delta;
+ if (amount < 0 && delta) amount -= win->hints->height_inc;
maxy = amount + win->height;
}
@@ -378,6 +379,9 @@ maximize_normal (rp_window *win)
/* Fit the window inside its frame (if it has one) */
if (win->frame)
{
+ PRINT_DEBUG ("frame width=%d height=%d\n",
+ win->frame->width, win->frame->height);
+
if (maxx > win->frame->width) maxx = win->frame->width
- win->border * 2;
if (maxy > win->frame->height) maxy = win->frame->height
@@ -389,17 +393,18 @@ maximize_normal (rp_window *win)
if (win->hints->flags & PResizeInc)
{
int amount;
+ int delta;
amount = maxx - win->width;
- amount -= amount % win->hints->width_inc;
- if (amount < 0) amount -= win->hints->width_inc;
- PRINT_DEBUG ("amount x: %d\n", amount);
+ delta = amount % win->hints->width_inc;
+ amount -= delta;
+ if (amount < 0 && delta) amount -= win->hints->width_inc;
maxx = amount + win->width;
amount = maxy - win->height;
- amount -= amount % win->hints->height_inc;
- if (amount < 0) amount -= win->hints->height_inc;
- PRINT_DEBUG ("amount y: %d\n", amount);
+ delta = amount % win->hints->height_inc;
+ amount -= delta;
+ if (amount < 0 && delta) amount -= win->hints->height_inc;
maxy = amount + win->height;
}