im.pidgin.pidgin: 02ceb2c6297e1fffb5870c6755ddc0ae3a864eee

charkins at pidgin.im charkins at pidgin.im
Sun Oct 28 14:20:40 EDT 2007


-----------------------------------------------------------------
Revision: 02ceb2c6297e1fffb5870c6755ddc0ae3a864eee
Ancestor: 37e81a57e46d4d1e09aa69c447b5146a9cf81455
Author: charkins at pidgin.im
Date: 2007-10-28T18:13:50
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Track the actual visibility for the buddy list (unobscured, partially and
fully obscured). This maintains the behavior from the previous commit
(raising partially obscured buddy list instead of hiding), but also
maintains refreshing of the buddy list when partially obscured which the
previous commit broke.


-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	658d620e3ebaf6dba98ee2aa0b8987af5d2c9c61
+++ pidgin/gtkblist.c	4d1fcc0cac6b1da88db88019f15c58083f76b44d
@@ -111,7 +111,7 @@ static guint visibility_manager_count = 
 static GtkWidget *accountmenu = NULL;
 
 static guint visibility_manager_count = 0;
-static gboolean gtk_blist_obscured = FALSE;
+static GdkVisibilityState gtk_blist_visibility = GDK_VISIBILITY_UNOBSCURED;
 static gboolean editing_blist = FALSE;
 
 static GList *pidgin_blist_sort_methods = NULL;
@@ -174,14 +174,14 @@ static gboolean gtk_blist_visibility_cb(
  ***************************************************/
 static gboolean gtk_blist_visibility_cb(GtkWidget *w, GdkEventVisibility *event, gpointer data)
 {
-	if (event->state == GDK_VISIBILITY_FULLY_OBSCURED ||
-		event->state == GDK_VISIBILITY_PARTIAL) {
+	GdkVisibilityState old_state = gtk_blist_visibility;
+	gtk_blist_visibility = event->state;
 
-		gtk_blist_obscured = TRUE;
+	if (gtk_blist_visibility == GDK_VISIBILITY_FULLY_OBSCURED &&
+		old_state != GDK_VISIBILITY_FULLY_OBSCURED) {
 
-	} else if (gtk_blist_obscured) {
-			gtk_blist_obscured = FALSE;
-			pidgin_blist_refresh_timer(purple_get_blist());
+		/* no longer fully obscured */
+		pidgin_blist_refresh_timer(purple_get_blist());
 	}
 
 	/* continue to handle event normally */
@@ -3768,7 +3768,8 @@ static gboolean pidgin_blist_refresh_tim
 {
 	PurpleBlistNode *gnode, *cnode;
 
-	if (gtk_blist_obscured || !GTK_WIDGET_VISIBLE(gtkblist->window))
+	if (gtk_blist_visibility == GDK_VISIBILITY_FULLY_OBSCURED
+			|| !GTK_WIDGET_VISIBLE(gtkblist->window)) 
 		return TRUE;
 
 	for(gnode = list->root; gnode; gnode = gnode->next) {
@@ -6331,7 +6332,8 @@ pidgin_blist_toggle_visibility()
 {
 	if (gtkblist && gtkblist->window) {
 		if (GTK_WIDGET_VISIBLE(gtkblist->window)) {
-			purple_blist_set_visible(PIDGIN_WINDOW_ICONIFIED(gtkblist->window) || gtk_blist_obscured);
+			purple_blist_set_visible(PIDGIN_WINDOW_ICONIFIED(gtkblist->window) ||
+					gtk_blist_visibility != GDK_VISIBILITY_UNOBSCURED);
 		} else {
 			purple_blist_set_visible(TRUE);
 		}


More information about the Commits mailing list