about summary refs log tree commit diff stats
path: root/src/ui/core.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-02-04 23:35:28 +0000
committerJames Booth <boothj5@gmail.com>2015-02-04 23:35:28 +0000
commit30180ac8bb125e4cae03c415201f796863d4c80b (patch)
treebf9ad3ce7699276918a2fda7436b575a2607b9f6 /src/ui/core.c
parentd64c4a69d76aa982f1631449169e35e6eb77bc89 (diff)
downloadprofani-tty-30180ac8bb125e4cae03c415201f796863d4c80b.tar.gz
Move SIGWINCH handling to ui/core.c, ignore signal whilst resizing
Diffstat (limited to 'src/ui/core.c')
-rw-r--r--src/ui/core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index de3bafd2..add80dff 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -79,6 +79,8 @@ static char *win_title;
 
 static int inp_size;
 
+static gboolean perform_resize = FALSE;
+
 #ifdef HAVE_LIBXSS
 static Display *display;
 #endif
@@ -121,6 +123,12 @@ ui_init(void)
 }
 
 void
+ui_sigwinch_handler(int sig)
+{
+    perform_resize = TRUE;
+}
+
+void
 ui_update(void)
 {
     ProfWin *current = wins_get_current();
@@ -137,6 +145,13 @@ ui_update(void)
     status_bar_update_virtual();
     inp_put_back();
     doupdate();
+
+    if (perform_resize) {
+        signal(SIGWINCH, SIG_IGN);
+        ui_resize();
+        perform_resize = FALSE;
+        signal(SIGWINCH, ui_sigwinch_handler);
+    }
 }
 
 void