mcabber/mcabber/main.c
changeset 2231 387cea2a1a81
parent 2228 1afa40f1d80d
child 2268 f5402d705f67
--- a/mcabber/mcabber/main.c	Wed Nov 11 10:06:46 2015 +0100
+++ b/mcabber/mcabber/main.c	Sun Nov 15 17:03:41 2015 +0100
@@ -63,7 +63,12 @@
 # define WAIT_ANY -1
 #endif
 
-static unsigned int terminate_ui;
+#ifdef USE_SIGWINCH
+void sigwinch_resize(void);
+static bool sigwinch;
+#endif
+
+static bool terminate_ui;
 GMainContext *main_context;
 
 static struct termios *backup_termios;
@@ -123,8 +128,7 @@
     mcabber_terminate("Killed by SIGHUP");
 #ifdef USE_SIGWINCH
   } else if (signum == SIGWINCH) {
-    if (scr_curses_status())
-      ungetch(KEY_RESIZE);
+    sigwinch = TRUE;
 #endif
   } else {
     scr_LogPrint(LPRINT_LOGNORM, "Caught signal: %d", signum);
@@ -555,6 +559,12 @@
     while(!terminate_ui) {
       if (g_main_context_iteration(main_context, TRUE) == FALSE)
         keyboard_activity();
+#ifdef USE_SIGWINCH
+      if (sigwinch) {
+        sigwinch_resize();
+        sigwinch = FALSE;
+      }
+#endif
       if (update_roster)
         scr_draw_roster();
       scr_do_update();