From: <aar...@us...> - 2006-06-22 06:00:29
|
Revision: 16305 Author: aaronsheldon Date: 2006-06-21 23:00:25 -0700 (Wed, 21 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16305&view=rev Log Message: ----------- No longer refreshes the GTK Buddy List when it isn't visible, be it iconified, shrunk into the system tray or just stuck behind other windows. When it is brought back to a visible state, an update is quickly done. One small revert and one style/ordering fix. Modified Paths: -------------- branches/soc-2006-blist-efficiency/src/gtkblist.c Modified: branches/soc-2006-blist-efficiency/src/gtkblist.c =================================================================== --- branches/soc-2006-blist-efficiency/src/gtkblist.c 2006-06-21 15:19:28 UTC (rev 16304) +++ branches/soc-2006-blist-efficiency/src/gtkblist.c 2006-06-22 06:00:25 UTC (rev 16305) @@ -118,6 +118,7 @@ #endif static GaimGtkBuddyList *gtkblist = NULL; +static gboolean gaim_gtk_blist_refresh_timer(GaimBuddyList *list); static void gaim_gtk_blist_update_buddy(GaimBuddyList *list, GaimBlistNode *node); static void gaim_gtk_blist_selection_changed(GtkTreeSelection *selection, gpointer data); static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node); @@ -160,8 +161,10 @@ { if (event->state == GDK_VISIBILITY_FULLY_OBSCURED) gtk_blist_obscured = TRUE; - else - gtk_blist_obscured = FALSE; + else if (gtk_blist_obscured) { + gtk_blist_obscured = FALSE; + gaim_gtk_blist_refresh_timer(gaim_get_blist()); + } /* continue to handle event normally */ return FALSE; @@ -172,8 +175,10 @@ if(event->changed_mask & GDK_WINDOW_STATE_WITHDRAWN) { if(event->new_window_state & GDK_WINDOW_STATE_WITHDRAWN) gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", FALSE); - else + else { gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", TRUE); + gaim_gtk_blist_refresh_timer(gaim_get_blist()); + } } if(event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) { @@ -182,7 +187,13 @@ else gaim_prefs_set_bool("/gaim/gtk/blist/list_maximized", FALSE); } - + + /* Refresh gtkblist if un-iconifying */ + if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED){ + if (!(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)) + gaim_gtk_blist_refresh_timer(gaim_get_blist()); + } + return FALSE; } @@ -3052,6 +3063,9 @@ { GaimBlistNode *gnode, *cnode; + if (gtk_blist_obscured || !GTK_WIDGET_VISIBLE(gtkblist->window)) + return TRUE; + for(gnode = list->root; gnode; gnode = gnode->next) { if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) continue; @@ -3995,7 +4009,7 @@ gtkblist->selected_node = new_selection; if(new_selection) gaim_gtk_blist_update(NULL, new_selection); - else if(old_selection) + if(old_selection) gaim_gtk_blist_update(NULL, old_selection); } @@ -4088,10 +4102,10 @@ if (GAIM_BLIST_NODE_IS_GROUP(node)) gnode = node; + else if (GAIM_BLIST_NODE_IS_BUDDY(node)) /* maybe OR'ed with IS_CHAT? */ + gnode = node->parent->parent; else if (GAIM_BLIST_NODE_IS_CONTACT(node)) gnode = node->parent; - else if (GAIM_BLIST_NODE_IS_BUDDY(node)) //maybe OR'ed with IS_CHAT? - gnode = node->parent->parent; g_return_if_fail(GAIM_BLIST_NODE_IS_GROUP(gnode)); group = (GaimGroup*)gnode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |