summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-02-22 07:40:55 +0100
committerSébastien Helleu <flashcode@flashtux.org>2017-02-22 07:40:55 +0100
commitf4c2328abf1cbe652dd515833e76730f218d1656 (patch)
treeec518591f655d9490742b1babf86cecddaa20f18 /src/gui
parente6d5d791cd2edd907eecb205f5c05a5e23d8df27 (diff)
downloadweechat-f4c2328abf1cbe652dd515833e76730f218d1656.zip
core: send signal "signal_sigwinch" after refreshs (issue #902)
Sending the signal after the refreshs will let scripts receive the good size for windows/bars/terminal, ie the size computed with the new terminal size.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-curses-main.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 9d03da860..20b203856 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -427,6 +427,9 @@ void
gui_main_loop ()
{
struct t_hook *hook_fd_keyboard;
+ int send_signal_sigwinch;
+
+ send_signal_sigwinch = 0;
/* catch SIGWINCH signal: redraw screen */
util_catch_signal (SIGWINCH, &gui_main_signal_sigwinch);
@@ -453,16 +456,22 @@ gui_main_loop ()
if (gui_signal_sigwinch_received)
{
- (void) hook_signal_send ("signal_sigwinch",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
- gui_signal_sigwinch_received = 0;
gui_window_ask_refresh (2);
+ gui_signal_sigwinch_received = 0;
+ send_signal_sigwinch = 1;
}
gui_main_refreshs ();
if (gui_window_refresh_needed && !gui_window_bare_display)
gui_main_refreshs ();
+ if (send_signal_sigwinch)
+ {
+ (void) hook_signal_send ("signal_sigwinch",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ send_signal_sigwinch = 0;
+ }
+
gui_color_pairs_auto_reset_pending = 0;
/* execute fd hooks */