comparison mcabber/src/screen.c @ 154:8630b7cae87b

[/trunk] Changeset 166 by mikael * Try to prevent segfaults when resizing intensively.
author mikael
date Sun, 01 May 2005 05:03:14 +0000
parents ae0844311710
children 409ff07d9fe2
comparison
equal deleted inserted replaced
153:ae0844311710 154:8630b7cae87b
195 y = 0; 195 y = 0;
196 lines = CHAT_WIN_HEIGHT; 196 lines = CHAT_WIN_HEIGHT;
197 cols = maxX - ROSTER_WIDTH; 197 cols = maxX - ROSTER_WIDTH;
198 198
199 tmp->win = newwin(lines, cols, y, x); 199 tmp->win = newwin(lines, cols, y, x);
200 while (!tmp->win) {
201 usleep(250);
202 tmp->win = newwin(lines, cols, y, x);
203 }
200 tmp->panel = new_panel(tmp->win); 204 tmp->panel = new_panel(tmp->win);
201 tmp->name = (char *) calloc(1, 96); 205 tmp->name = (char *) calloc(1, 96);
202 strncpy(tmp->name, title, 96); 206 strncpy(tmp->name, title, 96);
203 scr_clear_box(tmp->win, 0, 0, lines, cols, COLOR_GENERAL); 207 scr_clear_box(tmp->win, 0, 0, lines, cols, COLOR_GENERAL);
204 208
551 delwin(w_buddy); 555 delwin(w_buddy);
552 } 556 }
553 } 557 }
554 558
555 // Refresh current buddy window 559 // Refresh current buddy window
556 if (chatmode) 560 if (chatmode) {
561 usleep(100);
557 scr_ShowBuddyWindow(); 562 scr_ShowBuddyWindow();
563 }
564 // NCurses is very bad wrt memory (can lead to segfaults) so let's slow
565 // things down...
566 usleep(200);
558 } 567 }
559 568
560 // scr_DrawRoster() 569 // scr_DrawRoster()
561 // Actually, display the buddylist on the screen. 570 // Actually, display the buddylist on the screen.
562 void scr_DrawRoster(void) 571 void scr_DrawRoster(void)