# HG changeset patch # User Casey Harkins # Date 1193595230 0 # Node ID 094bbbe89d0d4d75fe3e220ff3ece38e9936a2ce # Parent cb086fef7ca115fbe9c7e1081f5406ccd35360d8 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. diff -r cb086fef7ca1 -r 094bbbe89d0d pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sun Oct 28 17:53:14 2007 +0000 +++ b/pidgin/gtkblist.c Sun Oct 28 18:13:50 2007 +0000 @@ -111,7 +111,7 @@ 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(GtkWidget *w, GdkEventVisibility *event, gpointer data) { - if (event->state == GDK_VISIBILITY_FULLY_OBSCURED || - event->state == GDK_VISIBILITY_PARTIAL) { - - gtk_blist_obscured = TRUE; - - } else if (gtk_blist_obscured) { - gtk_blist_obscured = FALSE; - pidgin_blist_refresh_timer(purple_get_blist()); + GdkVisibilityState old_state = gtk_blist_visibility; + gtk_blist_visibility = event->state; + + if (gtk_blist_visibility == GDK_VISIBILITY_FULLY_OBSCURED && + old_state != GDK_VISIBILITY_FULLY_OBSCURED) { + + /* no longer fully obscured */ + pidgin_blist_refresh_timer(purple_get_blist()); } /* continue to handle event normally */ @@ -3768,7 +3768,8 @@ { 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 @@ { 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); }