Mercurial > pidgin
changeset 19580:1cba50791c36
Fixes #2340, remember size/position separately for more places
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Mon, 03 Sep 2007 02:19:10 +0000 |
parents | 1c5d0f2c2d4e |
children | d4fb44035799 |
files | pidgin/gtkconv.c |
diffstat | 1 files changed, 25 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkconv.c Mon Sep 03 02:16:08 2007 +0000 +++ b/pidgin/gtkconv.c Mon Sep 03 02:19:10 2007 +0000 @@ -9116,7 +9116,7 @@ /* This one places conversations in the last made window of the same type. */ static gboolean -conv_placement_new_window_by_type_configured_cb(GtkWidget *w, +conv_placement_last_created_win_type_configured_cb(GtkWidget *w, GdkEventConfigure *event, PidginConversation *conv) { int x, y; @@ -9163,34 +9163,6 @@ } static void -conv_placement_new_window_by_type(PidginConversation *conv) -{ - PidginWindow *win = pidgin_conv_window_new(); - - if (purple_conversation_get_type(conv->active_conv) == - PURPLE_CONV_TYPE_IM || - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/width") == 0) { - pidgin_conv_set_position_size(win, - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/x"), - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/y"), - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/width"), - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/height")); - } else if (PURPLE_CONV_TYPE_CHAT == purple_conversation_get_type(conv->active_conv)) { - pidgin_conv_set_position_size(win, - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/x"), - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/y"), - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/width"), - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/height")); - } - - pidgin_conv_window_add_gtkconv(win, conv); - pidgin_conv_window_show(win); - - g_signal_connect(G_OBJECT(win->window), "configure_event", - G_CALLBACK(conv_placement_new_window_by_type_configured_cb), conv); -} - -static void conv_placement_last_created_win_type(PidginConversation *conv) { PidginWindow *win; @@ -9198,7 +9170,28 @@ win = pidgin_conv_window_last_with_type(purple_conversation_get_type(conv->active_conv)); if (win == NULL) { - conv_placement_new_window_by_type(conv); + win = pidgin_conv_window_new(); + + if (PURPLE_CONV_TYPE_IM == purple_conversation_get_type(conv->active_conv) || + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/width") == 0) { + pidgin_conv_set_position_size(win, + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/x"), + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/y"), + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/width"), + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/height")); + } else if (PURPLE_CONV_TYPE_CHAT == purple_conversation_get_type(conv->active_conv)) { + pidgin_conv_set_position_size(win, + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/x"), + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/y"), + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/width"), + purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/height")); + } + + pidgin_conv_window_add_gtkconv(win, conv); + pidgin_conv_window_show(win); + + g_signal_connect(G_OBJECT(win->window), "configure_event", + G_CALLBACK(conv_placement_last_created_win_type_configured_cb), conv); } else pidgin_conv_window_add_gtkconv(win, conv); } @@ -9362,7 +9355,7 @@ add_conv_placement_fnc("im_chat", _("Separate IM and Chat windows"), conv_placement_last_created_win_type); add_conv_placement_fnc("new", _("New window"), - conv_placement_new_window_by_type); + conv_placement_new_window); add_conv_placement_fnc("group", _("By group"), conv_placement_by_group); add_conv_placement_fnc("account", _("By account"), @@ -9470,7 +9463,7 @@ if (place_conv) place_conv(gtkconv); else - conv_placement_new_window_by_type(gtkconv); + conv_placement_new_window(gtkconv); } gboolean