summaryrefslogtreecommitdiff
path: root/src/gui/curses
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-01-21 14:19:12 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-01-21 14:19:12 +0100
commit5c661a497f8337df6ed1cb5e87637fd485a617c8 (patch)
tree1c7e2df3aa497ce493fd6a66639eaf09a525dcb1 /src/gui/curses
parent5d1568ecc29ef7ed48f53f7596e3b2b17d66759c (diff)
downloadweechat-5c661a497f8337df6ed1cb5e87637fd485a617c8.zip
core: delay the signal "signal_sigwinch" after WeeChat screen refresh
The signal is sent after WeeChat screen refresh, so all sizes for windows, bars, ... are already adjusted to the new terminal size.
Diffstat (limited to 'src/gui/curses')
-rw-r--r--src/gui/curses/gui-curses-main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 818ca58e2..f5940aa69 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -60,6 +60,7 @@
int gui_reload_config = 0;
+int gui_signal_sigwinch_received = 0;
int gui_term_cols = 0;
int gui_term_lines = 0;
@@ -296,9 +297,9 @@ gui_main_signal_sighup ()
void
gui_main_signal_sigwinch ()
{
- gui_window_ask_refresh (2);
+ gui_signal_sigwinch_received = 1;
- hook_signal_send ("signal_sigwinch", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ gui_window_ask_refresh (2);
}
/*
@@ -478,6 +479,13 @@ gui_main_loop ()
if (gui_window_refresh_needed)
gui_main_refreshs ();
+ if (gui_signal_sigwinch_received)
+ {
+ hook_signal_send ("signal_sigwinch",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ gui_signal_sigwinch_received = 0;
+ }
+
gui_color_pairs_auto_reset_pending = 0;
/* wait for keyboard or network activity */