diff src/gtkblist.c @ 12232:375f1f3817a8

[gaim-migrate @ 14534] Displaying large logs is slow. Let's show the busy cursor whenever possible. This currently doesn't show the busy cursor over the IMHTMLs in a conversation window even though I set a busy cursor for the conversation window. I looked into fixing that, but I'm not sure exactly what the best way to deal with it is. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sun, 27 Nov 2005 03:20:35 +0000
parents df0e16ecfb2a
children 36d3b1eaf20e
line wrap: on
line diff
--- a/src/gtkblist.c	Sun Nov 27 03:17:05 2005 +0000
+++ b/src/gtkblist.c	Sun Nov 27 03:20:35 2005 +0000
@@ -345,10 +345,16 @@
 
 static void gtk_blist_menu_showlog_cb(GtkWidget *w, GaimBlistNode *node)
 {
+	GdkCursor *cursor = gdk_cursor_new(GDK_WATCH);
 	GaimLogType type;
 	GaimAccount *account;
 	char *name = NULL;
 
+	gdk_window_set_cursor(gtkblist->window->window, cursor);
+	gdk_cursor_unref(cursor);
+	while (gtk_events_pending())
+		gtk_main_iteration();
+
 	if (GAIM_BLIST_NODE_IS_BUDDY(node)) {
 		GaimBuddy *b = (GaimBuddy*) node;
 		type = GAIM_LOG_IM;
@@ -365,13 +371,21 @@
 		}
 	} else if (GAIM_BLIST_NODE_IS_CONTACT(node)) {
 		gaim_gtk_log_show_contact((GaimContact *)node);
+		gdk_window_set_cursor(gtkblist->window->window, NULL);
 		return;
-	} else
-		return;
+	} else {
+		gdk_window_set_cursor(gtkblist->window->window, NULL);
+
+		/* This callback should not have been registered for a node
+		 * that doesn't match the type of one of the blocks above. */
+		g_return_if_reached();
+	}
 
 	if (name && account) {
 		gaim_gtk_log_show(type, name, account);
 		g_free(name);
+
+		gdk_window_set_cursor(gtkblist->window->window, NULL);
 	}
 }
 
@@ -1372,9 +1386,7 @@
 			gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkitem)));
 
 	if(gtkblist->window->window) {
-		GdkCursor *cursor = gdk_cursor_new(GDK_LEFT_PTR);
-		gdk_window_set_cursor(gtkblist->window->window, cursor);
-		gdk_cursor_unref(cursor);
+		gdk_window_set_cursor(gtkblist->window->window, NULL);
 	}
 }