changeset 19579:1c5d0f2c2d4e

Fixes #2340, remember size/position separately for more places
author Ka-Hing Cheung <khc@hxbc.us>
date Mon, 03 Sep 2007 02:16:08 +0000
parents 6e08084a27aa
children 1cba50791c36 4e147af6a033
files pidgin/gtkconv.c pidgin/gtkmain.c
diffstat 2 files changed, 41 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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