aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-06-05 14:01:19 +0100
committerThomas Adam <thomas@xteddy.org>2020-06-05 14:01:19 +0100
commit92c8cc17c3ec1dfbad83876b9308b107fbfab119 (patch)
treebc321c9e05b48bb023207862b767a2a3f9577569 /window.c
parent47a5afe5bf91f0525aacba691829a36156213e17 (diff)
parentd919fa1ed0ea3b167ffc811abba26a2dbcd20631 (diff)
downloadrtmux-92c8cc17c3ec1dfbad83876b9308b107fbfab119.tar.gz
rtmux-92c8cc17c3ec1dfbad83876b9308b107fbfab119.tar.bz2
rtmux-92c8cc17c3ec1dfbad83876b9308b107fbfab119.zip
Merge branch 'obsd-master'
Diffstat (limited to 'window.c')
-rw-r--r--window.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/window.c b/window.c
index b4fd91e1..b73d2ce6 100644
--- a/window.c
+++ b/window.c
@@ -434,14 +434,21 @@ window_resize(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
}
void
-window_pane_send_resize(struct window_pane *wp, int yadjust)
+window_pane_send_resize(struct window_pane *wp, int force)
{
struct window *w = wp->window;
struct winsize ws;
- u_int sy = wp->sy + yadjust;
+ u_int sy;
if (wp->fd == -1)
return;
+
+ if (!force)
+ sy = wp->sy;
+ else if (wp->sy <= 1)
+ sy = wp->sy + 1;
+ else
+ sy = wp->sy - 1;
log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, wp->sx, sy);
memset(&ws, 0, sizeof ws);
@@ -884,8 +891,8 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->xoff = 0;
wp->yoff = 0;
- wp->sx = wp->osx = sx;
- wp->sy = wp->osx = sy;
+ wp->sx = sx;
+ wp->sy = sy;
wp->pipe_fd = -1;
wp->pipe_event = NULL;
@@ -928,6 +935,8 @@ window_pane_destroy(struct window_pane *wp)
if (event_initialized(&wp->resize_timer))
event_del(&wp->resize_timer);
+ if (event_initialized(&wp->force_timer))
+ event_del(&wp->force_timer);
RB_REMOVE(window_pane_tree, &all_window_panes, wp);
@@ -1008,7 +1017,14 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
wme = TAILQ_FIRST(&wp->modes);
if (wme != NULL && wme->mode->resize != NULL)
wme->mode->resize(wme, sx, sy);
- wp->flags |= (PANE_RESIZE|PANE_RESIZED);
+
+ /*
+ * If the pane has already been resized, set the force flag and make
+ * the application resize twice to force it to redraw.
+ */
+ if (wp->flags & PANE_RESIZE)
+ wp->flags |= PANE_RESIZEFORCE;
+ wp->flags |= PANE_RESIZE;
}
void