# HG changeset patch # User Ka-Hing Cheung # Date 1188785768 0 # Node ID 1c5d0f2c2d4eeb7a90c3bb219b0b421b5694447e # Parent 6e08084a27aaf78a46eb03b18b1aab17f33ff82f Fixes #2340, remember size/position separately for more places diff -r 6e08084a27aa -r 1c5d0f2c2d4e pidgin/gtkconv.c --- a/pidgin/gtkconv.c Mon Sep 03 00:45:23 2007 +0000 +++ b/pidgin/gtkconv.c Mon Sep 03 02:16:08 2007 +0000 @@ -9116,7 +9116,7 @@ /* This one places conversations in the last made window of the same type. */ static gboolean -conv_placement_last_created_win_type_configured_cb(GtkWidget *w, +conv_placement_new_window_by_type_configured_cb(GtkWidget *w, GdkEventConfigure *event, PidginConversation *conv) { int x, y; @@ -9163,6 +9163,34 @@ } 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; @@ -9170,28 +9198,7 @@ win = pidgin_conv_window_last_with_type(purple_conversation_get_type(conv->active_conv)); if (win == NULL) { - 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); + conv_placement_new_window_by_type(conv); } else pidgin_conv_window_add_gtkconv(win, conv); } @@ -9355,7 +9362,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); + conv_placement_new_window_by_type); add_conv_placement_fnc("group", _("By group"), conv_placement_by_group); add_conv_placement_fnc("account", _("By account"), @@ -9463,7 +9470,7 @@ if (place_conv) place_conv(gtkconv); else - conv_placement_new_window(gtkconv); + conv_placement_new_window_by_type(gtkconv); } gboolean diff -r 6e08084a27aa -r 1c5d0f2c2d4e pidgin/gtkmain.c --- a/pidgin/gtkmain.c Mon Sep 03 00:45:23 2007 +0000 +++ b/pidgin/gtkmain.c Mon Sep 03 02:16:08 2007 +0000 @@ -86,6 +86,8 @@ static SnDisplay *sn_display = NULL; #endif +#include "/home/khc/Code/scratch/memory_profile.c" + #ifdef HAVE_SIGNAL_H /* @@ -100,6 +102,7 @@ SIGQUIT, SIGCHLD, SIGALRM, + SIGUSR2, -1 }; @@ -215,6 +218,9 @@ case SIGALRM: clean_pid(); break; + case SIGUSR2: + mp_tally(); + break; default: purple_debug_warning("sighandler", "Caught signal %d\n", sig); purple_connections_disconnect_all(); @@ -484,6 +490,9 @@ {0, 0, 0, 0} }; + //g_mem_set_vtable(&memhook); + //mp_init(); + #ifdef DEBUG debug_enabled = TRUE; #else