diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-10 19:13:54 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-10 19:13:54 +0000 |
commit | a900cb580fd0ac1b617dfa4357b5c4cd7b126bc1 (patch) | |
tree | 859c846d5057d3d6a27c5ac7ad4e64ffb1173137 /src/fe-text/mainwindows.c | |
parent | fc890ebd8230d6248e990d0bf88bec0133f8ab8b (diff) | |
download | irssi-a900cb580fd0ac1b617dfa4357b5c4cd7b126bc1.zip |
Windowing system fixes, doesn't crash anymore after window resizes.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@577 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/mainwindows.c')
-rw-r--r-- | src/fe-text/mainwindows.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 0d5fa25c..c5fa3d25 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -57,12 +57,6 @@ static MAIN_WINDOW_REC *find_window_with_room(void) return biggest_rec; } -static void create_curses_window(MAIN_WINDOW_REC *window) -{ - window->curses_win = - subwin(stdscr, window->lines, COLS, window->first_line, 0); -} - static void mainwindow_resize(MAIN_WINDOW_REC *window, int ychange, int xchange) { GSList *tmp; @@ -70,8 +64,8 @@ static void mainwindow_resize(MAIN_WINDOW_REC *window, int ychange, int xchange) if (ychange == 0 && !xchange) return; window->lines = window->last_line-window->first_line+1; - delwin(window->curses_win); - create_curses_window(window); + wresize(window->curses_win, window->lines, COLS); + mvwin(window->curses_win, window->first_line, 0); for (tmp = windows; tmp != NULL; tmp = tmp->next) { WINDOW_REC *rec = tmp->data; @@ -110,13 +104,13 @@ MAIN_WINDOW_REC *mainwindow_create(void) rec->lines = rec->last_line-rec->first_line+1; parent->first_line = rec->last_line+1+rec->statusbar_lines; parent->lines = parent->last_line-parent->first_line+1; - delwin(parent->curses_win); - create_curses_window(parent); mainwindow_resize(parent, -space-1, FALSE); } - create_curses_window(rec); + rec->curses_win = newwin(rec->lines, COLS, rec->first_line, 0); + refresh(); + mainwindows = g_slist_append(mainwindows, rec); signal_emit("mainwindow created", 1, rec); return rec; @@ -416,7 +410,8 @@ int mainwindows_reserve_lines(int count, int up) return ret; } -static void mainwindows_resize_two(MAIN_WINDOW_REC *grow_win, MAIN_WINDOW_REC *shrink_win, int count) +static void mainwindows_resize_two(MAIN_WINDOW_REC *grow_win, + MAIN_WINDOW_REC *shrink_win, int count) { mainwindow_resize(grow_win, count, FALSE); mainwindow_resize(shrink_win, -count, FALSE); @@ -526,6 +521,7 @@ static void cmd_window_balance(void) rec->first_line = last_line+1; rec->last_line = rec->first_line-1 + unit_size - rec->statusbar_lines; + rec->lines = rec->last_line-rec->first_line+1; if (bigger_units > 0) { rec->last_line++; |