From b199cfd64424343f010198a5148db71a8b76c143 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 27 Oct 2012 15:02:17 +0200 Subject: [PATCH] NCursesUI: force input handling reexecution when resizing --- src/ncurses.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ncurses.cc b/src/ncurses.cc index 2051ca93..f70de2c2 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -4,6 +4,7 @@ #include "register_manager.hh" #include "utf8_iterator.hh" +#include "event_manager.hh" #include @@ -74,7 +75,7 @@ static void set_color(Color fg_color, Color bg_color) } } -static NCursesUI* signal_ui; +static NCursesUI* signal_ui = nullptr; void on_term_resize(int) { int fd = open("/dev/tty", O_RDWR); @@ -85,6 +86,7 @@ void on_term_resize(int) resizeterm(ws.ws_row, ws.ws_col); ungetch(KEY_RESIZE); signal_ui->update_dimensions(); + EventManager::instance().force_signal(0); } NCursesUI::NCursesUI() @@ -106,6 +108,7 @@ NCursesUI::NCursesUI() update_dimensions(); + assert(signal_ui == nullptr); signal_ui = this; signal(SIGWINCH, on_term_resize); }