diff options
author | sabetts <sabetts> | 2001-04-01 09:47:04 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-04-01 09:47:04 +0000 |
commit | fb48f797f8bee3990d169c77c74de9c0e0fd80d0 (patch) | |
tree | e5a054807e8a144a0f2129f1531e92aaff28c828 | |
parent | 299d16aa6ae37bd73ae92ee8a5d1c6715682ee35 (diff) | |
download | ratpoison-fb48f797f8bee3990d169c77c74de9c0e0fd80d0.zip |
(maximize_normal): fixed maximizing problems for
windows with resize hints.
(maximize_transient): likewise
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/manage.c | 29 |
2 files changed, 23 insertions, 12 deletions
@@ -1,3 +1,9 @@ +2001-04-01 shawn <sabetts@diggin.lamenet.tmp> + + * src/manage.c (maximize_normal): fixed maximizing problems for + windows with resize hints. + (maximize_transient): likewise + 2001-03-31 shawn <sabetts@diggin.lamenet.tmp> * src/split.h (find_window_for_frame): new function prototype 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; } |