changeset 12115:e9790eb93216

[gaim-migrate @ 14415] quoth charkins: " This patch has a few small fixes for the visibility stuff in gtkblist.c. First, tracking of the ICONIFIED state of the blist was removed. This was intended to allow the blist to "remember" if it was minimized between restarts. Unfortunately, this is not possible because the ICONIFIED state gets set when the blist is on a different desktop with many window managers. Second, while talking about the ICONIFIED issue on #gtk@GIMPNet, muntyan_ asked about a bug where the blist would get shown on an account re-connect with 1.5.0. Luke mentioned something about this with cvs as well. This patch introduces a check in gaim_gtk_blist_show() to prevent the window from being shown if it already exists and is visible. Third, sadrul pointed me to a one-line fix for the missing blist on startup. I added a second line to make sure the blist restores its proper size as well. Finally, when the last visibility manager is removed, gaim will now minimize the blist if it was previously hidden, rather than showing it. This could prevent a race condition with out-of-process applets, preventing gaim from maintaining the visibility state properly between restarts. This was 'cvs diff'ed against the last available anon cvs from Friday. Hopefully it'll apply cleanly." it did. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 16 Nov 2005 17:55:26 +0000
parents 2cbb5993c819
children e75ef7aa913e
files src/gtkblist.c
diffstat 1 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkblist.c	Wed Nov 16 16:59:22 2005 +0000
+++ b/src/gtkblist.c	Wed Nov 16 17:55:26 2005 +0000
@@ -173,13 +173,6 @@
 			gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", TRUE);
 	}
 
-	if(event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) {
-		if(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)
-			gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", FALSE);
-		else
-			gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", TRUE);
-	}
-
 	return FALSE;
 }
 
@@ -3301,7 +3294,8 @@
 				{"application/x-im-contact", 0, DRAG_BUDDY},
 				{"text/x-vcard", 0, DRAG_VCARD }};
 	if (gtkblist && gtkblist->window) {
-		gaim_blist_set_visible(gaim_prefs_get_bool("/gaim/gtk/blist/list_visible"));
+		if(!GTK_WIDGET_VISIBLE(gtkblist->window))
+			gaim_blist_set_visible(gaim_prefs_get_bool("/gaim/gtk/blist/list_visible"));
 		return;
 	}
 
@@ -4010,8 +4004,6 @@
 	if (!(gtkblist && gtkblist->window))
 		return;
 
-	//gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", show);
-
 	if (show) {
 		if(!GAIM_WINDOW_ICONIFIED(gtkblist->window) && !GTK_WIDGET_VISIBLE(gtkblist->window))
 			gaim_signal_emit(gaim_gtk_blist_get_handle(), "gtkblist-unhiding", gtkblist);
@@ -4022,6 +4014,8 @@
 			gaim_signal_emit(gaim_gtk_blist_get_handle(), "gtkblist-hiding", gtkblist);
 			gtk_widget_hide(gtkblist->window);
 		} else {
+			gaim_gtk_blist_restore_position();
+			gtk_widget_show_all(GTK_WIDGET(gtkblist->window));
 			gtk_window_iconify(GTK_WINDOW(gtkblist->window));
 		}
 	}
@@ -4667,7 +4661,7 @@
 	if (visibility_manager_count)
 		visibility_manager_count--;
 	if (!visibility_manager_count)
-		gaim_blist_set_visible(TRUE);
+		gaim_blist_set_visible(gaim_prefs_get_bool("/gaim/gtk/blist/list_visible"));
 }