diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/command.c | 4 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 2 | ||||
-rw-r--r-- | src/gui/gtk/gui-display.c | 2 | ||||
-rw-r--r-- | src/gui/gui-common.c | 9 | ||||
-rw-r--r-- | src/gui/gui.h | 2 | ||||
-rw-r--r-- | src/irc/irc-channel.c | 5 | ||||
-rw-r--r-- | src/irc/irc-recv.c | 4 | ||||
-rw-r--r-- | src/irc/irc-send.c | 2 | ||||
-rw-r--r-- | src/irc/irc-server.c | 2 | ||||
-rw-r--r-- | src/irc/irc.h | 2 |
10 files changed, 18 insertions, 16 deletions
diff --git a/src/common/command.c b/src/common/command.c index 8e8cc91ea..b4b02739f 100644 --- a/src/common/command.c +++ b/src/common/command.c @@ -849,7 +849,7 @@ weechat_cmd_connect (int argc, char **argv) return -1; } if (!ptr_server->window) - gui_window_new (ptr_server, NULL); + gui_window_new (ptr_server, NULL, 1); if (server_connect (ptr_server)) { irc_login (ptr_server); @@ -1425,7 +1425,7 @@ weechat_cmd_server (int argc, char **argv) if (new_server->autoconnect) { - gui_window_new (new_server, NULL); + gui_window_new (new_server, NULL, 1); if (server_connect (new_server)) irc_login (new_server); } diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index ed0fdc53e..d30c5e6fa 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -1395,7 +1395,7 @@ gui_init () gui_init_colors (); /* create a new window */ - gui_current_window = gui_window_new (NULL, NULL /*0, 0, COLS, LINES*/); + gui_current_window = gui_window_new (NULL, NULL, 1 /*0, 0, COLS, LINES*/); signal (SIGWINCH, gui_curses_resize_handler); diff --git a/src/gui/gtk/gui-display.c b/src/gui/gtk/gui-display.c index 29c3a4690..ca183b3e7 100644 --- a/src/gui/gtk/gui-display.c +++ b/src/gui/gtk/gui-display.c @@ -625,7 +625,7 @@ gui_init () gtk_widget_show_all (gtk_main_window); /* create a new window */ - gui_current_window = gui_window_new (NULL, NULL /*0, 0, COLS, LINES*/); + gui_current_window = gui_window_new (NULL, NULL, 1 /*0, 0, COLS, LINES*/); /* TODO: set gui_ready to 1 when Gtk display functions will be ok */ gui_ready = 1; diff --git a/src/gui/gui-common.c b/src/gui/gui-common.c index 723c19fe5..8ec65ccc0 100644 --- a/src/gui/gui-common.c +++ b/src/gui/gui-common.c @@ -52,7 +52,7 @@ t_gui_window *gui_current_window = NULL; /* pointer to current window */ */ t_gui_window * -gui_window_new (void *server, void *channel +gui_window_new (void *server, void *channel, int switch_to_window /*int x, int y, int width, int height*/) { t_gui_window *new_window; @@ -114,7 +114,8 @@ gui_window_new (void *server, void *channel new_window->ptr_history = NULL; /* switch to new window */ - gui_switch_to_window (new_window); + if (switch_to_window) + gui_switch_to_window (new_window); /* add window to windows queue */ new_window->prev_window = last_gui_window; @@ -126,7 +127,7 @@ gui_window_new (void *server, void *channel new_window->next_window = NULL; /* redraw whole screen */ - gui_redraw_window (new_window); + gui_redraw_window (gui_current_window); } else return NULL; @@ -235,7 +236,7 @@ gui_window_free (t_gui_window *window) /* always at least one window */ if (!gui_windows && create_new) - gui_window_new (NULL, NULL); + gui_window_new (NULL, NULL, 1); } /* diff --git a/src/gui/gui.h b/src/gui/gui.h index 370d09e91..d0fb54376 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -189,7 +189,7 @@ extern t_gui_window *gui_current_window; /* prototypes */ /* GUI independent functions */ -extern t_gui_window *gui_window_new (void *, void * /*int, int, int, int*/); /* TODO: add coordinates and size */ +extern t_gui_window *gui_window_new (void *, void *, int /*int, int, int, int*/); /* TODO: add coordinates and size */ extern void gui_window_clear (t_gui_window *); extern void gui_window_clear_all (); extern t_gui_line *gui_new_line (t_gui_window *); diff --git a/src/irc/irc-channel.c b/src/irc/irc-channel.c index ceab1d2cc..94b44d7ce 100644 --- a/src/irc/irc-channel.c +++ b/src/irc/irc-channel.c @@ -41,7 +41,8 @@ t_irc_channel *current_channel = NULL; */ t_irc_channel * -channel_new (t_irc_server *server, int channel_type, char *channel_name) +channel_new (t_irc_server *server, int channel_type, char *channel_name, + int switch_to_window) { t_irc_channel *new_channel; @@ -68,7 +69,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name) server->channels = new_channel; server->last_channel = new_channel; - gui_window_new (server, new_channel); + gui_window_new (server, new_channel, switch_to_window); /* all is ok, return address of new channel */ return new_channel; diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c index 31e66b738..db7cd291a 100644 --- a/src/irc/irc-recv.c +++ b/src/irc/irc-recv.c @@ -158,7 +158,7 @@ irc_cmd_recv_join (t_irc_server *server, char *host, char *arguments) ptr_channel = channel_search (server, arguments); if (!ptr_channel) { - ptr_channel = channel_new (server, CHAT_CHANNEL, arguments); + ptr_channel = channel_new (server, CHAT_CHANNEL, arguments, 1); if (!ptr_channel) { gui_printf (server->window, @@ -894,7 +894,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) ptr_channel = channel_search (server, host); if (!ptr_channel) { - ptr_channel = channel_new (server, CHAT_PRIVATE, host); + ptr_channel = channel_new (server, CHAT_PRIVATE, host, 0); if (!ptr_channel) { gui_printf (server->window, diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c index 4c9c025a0..dc74ce09c 100644 --- a/src/irc/irc-send.c +++ b/src/irc/irc-send.c @@ -487,7 +487,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments) ptr_channel = channel_search (server, arguments); if (!ptr_channel) { - ptr_channel = channel_new (server, CHAT_PRIVATE, arguments); + ptr_channel = channel_new (server, CHAT_PRIVATE, arguments, 1); if (!ptr_channel) { gui_printf (server->window, diff --git a/src/irc/irc-server.c b/src/irc/irc-server.c index 66404a232..bb4f85f4b 100644 --- a/src/irc/irc-server.c +++ b/src/irc/irc-server.c @@ -585,7 +585,7 @@ server_auto_connect () { if (ptr_server->autoconnect) { - gui_window_new (ptr_server, NULL); + gui_window_new (ptr_server, NULL, 1); if (server_connect (ptr_server)) irc_login (ptr_server); } diff --git a/src/irc/irc.h b/src/irc/irc.h index 614a78548..86c0818cd 100644 --- a/src/irc/irc.h +++ b/src/irc/irc.h @@ -161,7 +161,7 @@ extern int server_name_already_exists (char *); /* channel functions (irc-channel.c) */ -extern t_irc_channel *channel_new (t_irc_server *, int, char *); +extern t_irc_channel *channel_new (t_irc_server *, int, char *, int); extern void channel_free (t_irc_server *, t_irc_channel *); extern void channel_free_all (t_irc_server *); extern t_irc_channel *channel_search (t_irc_server *, char *); |