From 275c04a6aadf38e628a26c0a7e1d458469bec88c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 20 Nov 2001 02:43:43 +0000 Subject: [PATCH] Irssi didn't redraw the screen properly when split windows were created but were never set active. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2119 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/gui-windows.c | 11 +++++++---- src/fe-text/mainwindows.c | 1 + src/fe-text/statusbar.c | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/fe-text/gui-windows.c b/src/fe-text/gui-windows.c index ce984a97..4f0a8e48 100644 --- a/src/fe-text/gui-windows.c +++ b/src/fe-text/gui-windows.c @@ -48,6 +48,8 @@ static GUI_WINDOW_REC *gui_window_init(WINDOW_REC *window, settings_get_int("indent"), !settings_get_bool("indent_always"), get_default_indent_func()); + if (parent->active == window) + textbuffer_view_set_window(gui->view, parent->screen_win); return gui; } @@ -65,13 +67,14 @@ static void sig_window_create_override(gpointer tab) static void gui_window_created(WINDOW_REC *window, void *automatic) { MAIN_WINDOW_REC *parent; - int empty_window; + int empty_window, new_parent; g_return_if_fail(window != NULL); - parent = window_create_override != 0 && - active_win != NULL && WINDOW_GUI(active_win) != NULL ? - WINDOW_MAIN(active_win) : mainwindow_create(); + new_parent = window_create_override == 0 || + window_create_override == 2 || + active_win == NULL || WINDOW_GUI(active_win) == NULL; + parent = !new_parent ? WINDOW_MAIN(active_win) : mainwindow_create(); if (parent == NULL) { /* not enough space for new window, but we really can't abort creation of the window anymore, so create hidden diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 13f94e27..211fdb51 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -176,6 +176,7 @@ MAIN_WINDOW_REC *mainwindow_create(void) int space; rec = g_new0(MAIN_WINDOW_REC, 1); + rec->dirty = TRUE; rec->width = term_width; if (mainwindows == NULL) { diff --git a/src/fe-text/statusbar.c b/src/fe-text/statusbar.c index 986b153d..b1eb1454 100644 --- a/src/fe-text/statusbar.c +++ b/src/fe-text/statusbar.c @@ -1043,6 +1043,11 @@ static void sig_window_changed(void) } } +static void sig_gui_window_created(WINDOW_REC *window) +{ + statusbars_add_visible(WINDOW_MAIN(window)); +} + static void statusbar_item_def_destroy(void *key, void *value) { g_free(key); @@ -1088,6 +1093,7 @@ void statusbar_init(void) signal_add("terminal resized", (SIGNAL_FUNC) sig_terminal_resized); signal_add("mainwindow resized", (SIGNAL_FUNC) sig_mainwindow_resized); signal_add("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized); + signal_add("gui window created", (SIGNAL_FUNC) sig_gui_window_created); signal_add("window changed", (SIGNAL_FUNC) sig_window_changed); signal_add("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed); signal_add_last("setup reread", (SIGNAL_FUNC) sig_setup_reload); @@ -1119,6 +1125,7 @@ void statusbar_deinit(void) signal_remove("terminal resized", (SIGNAL_FUNC) sig_terminal_resized); signal_remove("mainwindow resized", (SIGNAL_FUNC) sig_mainwindow_resized); signal_remove("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized); + signal_remove("gui window created", (SIGNAL_FUNC) sig_gui_window_created); signal_remove("window changed", (SIGNAL_FUNC) sig_window_changed); signal_remove("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed); signal_remove("setup reread", (SIGNAL_FUNC) sig_setup_reload);