aboutsummaryrefslogtreecommitdiff
path: root/resize.c
diff options
context:
space:
mode:
Diffstat (limited to 'resize.c')
-rw-r--r--resize.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/resize.c b/resize.c
index 15d146d8..68717e35 100644
--- a/resize.c
+++ b/resize.c
@@ -61,6 +61,7 @@ resize_window(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
tty_update_window_offset(w);
server_redraw_window(w);
notify_window("window-layout-changed", w);
+ w->flags &= ~WINDOW_RESIZE;
}
static int
@@ -346,16 +347,30 @@ recalculate_size(struct window *w)
changed = 0;
break;
}
- if (changed && w->sx == sx && w->sy == sy)
- changed = 0;
+ if (w->flags & WINDOW_RESIZE) {
+ if (changed && w->new_sx == sx && w->new_sy == sy)
+ changed = 0;
+ } else {
+ if (changed && w->sx == sx && w->sy == sy)
+ changed = 0;
+ }
if (!changed) {
tty_update_window_offset(w);
return;
}
- log_debug("%s: @%u changed to %u,%u (%ux%u)", __func__, w->id, sx, sy,
- xpixel, ypixel);
- resize_window(w, sx, sy, xpixel, ypixel);
+ log_debug("%s: @%u new size %u,%u", __func__, w->id, sx, sy);
+ if (type == WINDOW_SIZE_MANUAL)
+ resize_window(w, sx, sy, xpixel, ypixel);
+ else {
+ w->new_sx = sx;
+ w->new_sy = sy;
+ w->new_xpixel = xpixel;
+ w->new_ypixel = ypixel;
+
+ w->flags |= WINDOW_RESIZE;
+ tty_update_window_offset(w);
+ }
}
void