diff mcabber/src/main.c @ 151:b69c0b7a23e3

[/trunk] Changeset 163 by mikael * Window resize handling 8-)
author mikael
date Sun, 01 May 2005 03:14:19 +0000
parents 9f74832eb4f8
children 05f606cfb9e4
line wrap: on
line diff
--- a/mcabber/src/main.c	Sun May 01 03:09:40 2005 +0000
+++ b/mcabber/src/main.c	Sun May 01 03:14:19 2005 +0000
@@ -81,6 +81,7 @@
   unsigned int ping;
   int ssl;
   int ret = 0;
+  unsigned int refresh = 0;
 
   credits();
 
@@ -150,7 +151,7 @@
   scr_InitCurses();
 
   ut_WriteLog("Drawing main window...\n");
-  scr_DrawMainWindow();
+  scr_DrawMainWindow(TRUE);
 
   optstring = cfg_read("logging");
   if (optstring && (atoi(optstring) > 0))
@@ -194,11 +195,17 @@
   ut_WriteLog("Ready to send/receive messages...\n");
 
   jb_reset_keepalive();
-  keypad(scr_GetInputWindow(), TRUE);
   while (ret != 255) {
     key = scr_Getch();
+
+    // The refresh is really an ugly hack, but we need to call doupdate()
+    // from time to time to catch the RESIZE events, because getch keep
+    // returning ERR until a real key is pressed :-(
     if (key != ERR)
       ret = process_key(key);
+    else if (++refresh % 2)
+      doupdate();
+
     jb_main();
     if (update_roster)
       scr_DrawRoster();