diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-10 20:01:32 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-10 20:01:32 +0000 |
commit | 92e0995223d4fd2ae567bad94605f5a475988f75 (patch) | |
tree | 8479e9bd9957ac98a11b504ae7935fdaffb1ab08 | |
parent | a25a912ec85792e92123be19be0d47098b0dc8b6 (diff) | |
download | irssi-92e0995223d4fd2ae567bad94605f5a475988f75.zip |
Still some fixes for curseses without wresize() or resizeterm().
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@579 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/fe-text/mainwindows.c | 21 | ||||
-rw-r--r-- | src/fe-text/mainwindows.h | 1 | ||||
-rw-r--r-- | src/fe-text/screen.c | 3 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index c5fa3d25..260b4dad 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -64,19 +64,38 @@ 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; +#ifdef HAVE_CURSES_WRESIZE wresize(window->curses_win, window->lines, COLS); mvwin(window->curses_win, window->first_line, 0); +#else + delwin(window->curses_win); + window->curses_win = newwin(window->lines, COLS, window->first_line, 0); +#endif for (tmp = windows; tmp != NULL; tmp = tmp->next) { WINDOW_REC *rec = tmp->data; - if (rec->gui_data != NULL && WINDOW_GUI(rec)->parent == window) + if (rec->gui_data != NULL && + WINDOW_GUI(rec)->parent == window) gui_window_resize(rec, ychange, xchange); } + gui_window_redraw(window->active); signal_emit("mainwindow resized", 1, window); } +void mainwindows_recreate(void) +{ + GSList *tmp; + + for (tmp = mainwindows; tmp != NULL; tmp = tmp->next) { + MAIN_WINDOW_REC *rec = tmp->data; + + rec->curses_win = newwin(rec->lines, COLS, rec->first_line, 0); + gui_window_redraw(rec->active); + } +} + MAIN_WINDOW_REC *mainwindow_create(void) { MAIN_WINDOW_REC *rec, *parent; diff --git a/src/fe-text/mainwindows.h b/src/fe-text/mainwindows.h index c163c366..db4eda57 100644 --- a/src/fe-text/mainwindows.h +++ b/src/fe-text/mainwindows.h @@ -24,6 +24,7 @@ void mainwindow_destroy(MAIN_WINDOW_REC *window); void mainwindows_redraw(void); void mainwindows_resize(int ychange, int xchange); +void mainwindows_recreate(void); int mainwindows_reserve_lines(int count, int up); diff --git a/src/fe-text/screen.c b/src/fe-text/screen.c index d640ddfb..4d6f101c 100644 --- a/src/fe-text/screen.c +++ b/src/fe-text/screen.c @@ -65,11 +65,12 @@ static void sig_winch(int p) /* Resize curses terminal */ ychange = ws.ws_row-LINES; xchange = ws.ws_col-COLS; -#ifdef HAVE_CURSES_RESIZETERM +#ifdef xHAVE_CURSES_RESIZETERM resizeterm(ws.ws_row, ws.ws_col); #else deinit_screen(); init_screen(); + mainwindows_recreate(); #endif mainwindows_resize(ychange, xchange != 0); |