From: nicm Date: Thu, 17 Feb 2022 09:58:47 +0000 (+0000) Subject: Add a window-resized hook which is fired when the window is actually X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ba37bc3ceacc60854971973afeaa04e00b0259c6;p=openbsd 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. --- diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c index a84d7f0be3c..231161e12f3 100644 --- a/usr.bin/tmux/options-table.c +++ b/usr.bin/tmux/options-table.c @@ -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 @@ -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 } diff --git a/usr.bin/tmux/resize.c b/usr.bin/tmux/resize.c index 5e22cf9c8bd..fd965b9a24d 100644 --- a/usr.bin/tmux/resize.c +++ b/usr.bin/tmux/resize.c @@ -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 @@ -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; }