From 8fccbbb02673bed71676412f1a313093a39c48ff Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 6 Dec 2021 10:08:42 +0000 Subject: Do not dereference NULL window when resizing client, GitHub issue 2982. --- resize.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'resize.c') diff --git a/resize.c b/resize.c index 8416ad6a..175dd740 100644 --- a/resize.c +++ b/resize.c @@ -348,6 +348,8 @@ recalculate_size_skip_client(struct client *loop, __unused int type, * is not the current window - this is used for aggressive-resize. * Otherwise skip any session that doesn't contain the window. */ + if (loop->session->curw == NULL) + return (1); if (current) return (loop->session->curw->window != w); return (session_has(loop->session, w) == 0); -- cgit From b2b94dcba73a62e2949fb98aee097dbaea658760 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 6 Jan 2022 08:20:00 +0000 Subject: Ignore windows without a size set (may be used for pane only), from Anindya Mukherjee. --- resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resize.c') diff --git a/resize.c b/resize.c index 175dd740..18a02adb 100644 --- a/resize.c +++ b/resize.c @@ -178,7 +178,7 @@ clients_calculate_size(int type, int current, struct client *c, cw = NULL; /* Work out this client's size. */ - if (cw != NULL) { + if (cw != NULL && cw->sx != 0 && cw->sy != 0) { cx = cw->sx; cy = cw->sy; } else { -- cgit From 818b2176ef52a13867905d3d3e0269dc1b4d6fb4 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 17 Feb 2022 09:58:47 +0000 Subject: Add a window-resized hook which is fired when the window is actually resized which may be later than the client resize, GitHub issue 2995. --- resize.c | 1 + 1 file changed, 1 insertion(+) (limited to 'resize.c') diff --git a/resize.c b/resize.c index 18a02adb..457fee0a 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); + notify_window("window-resized", w); w->flags &= ~WINDOW_RESIZE; } -- cgit