Add a window-resized hook which is fired when the window is actually
authornicm <nicm@openbsd.org>
Thu, 17 Feb 2022 09:58:47 +0000 (09:58 +0000)
committernicm <nicm@openbsd.org>
Thu, 17 Feb 2022 09:58:47 +0000 (09:58 +0000)
resized which may be later than the client resize, GitHub issue 2995.

usr.bin/tmux/options-table.c
usr.bin/tmux/resize.c

index a84d7f0..231161e 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: options-table.c,v 1.157 2022/02/15 13:11:29 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.158 2022/02/17 09:58:47 nicm Exp $ */
 
 /*
  * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1246,6 +1246,7 @@ const struct options_table_entry options_table[] = {
        OPTIONS_TABLE_HOOK("window-linked", ""),
        OPTIONS_TABLE_WINDOW_HOOK("window-pane-changed", ""),
        OPTIONS_TABLE_WINDOW_HOOK("window-renamed", ""),
+       OPTIONS_TABLE_WINDOW_HOOK("window-resized", ""),
        OPTIONS_TABLE_HOOK("window-unlinked", ""),
 
        { .name = NULL }
index 5e22cf9..fd965b9 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: resize.c,v 1.49 2022/01/06 08:20:00 nicm Exp $ */
+/* $OpenBSD: resize.c,v 1.50 2022/02/17 09:58:47 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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;
 }