Code

display busy cursor while filling
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 11 Mar 2007 03:35:16 +0000 (03:35 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 11 Mar 2007 03:35:16 +0000 (03:35 +0000)
src/flood-context.cpp

index 8be742021170e0b642a15acb47b7f5eb74d298ae..24c948241f36f6bc0b0d9e26dc7b55e490af738c 100644 (file)
@@ -755,11 +755,22 @@ static gint sp_flood_context_item_handler(SPEventContext *event_context, SPItem
 static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEvent *event)
 {
     gint ret = FALSE;
+    SPDesktop *desktop = event_context->desktop;
+
     switch (event->type) {
     case GDK_BUTTON_PRESS:
         if ( event->button.button == 1 ) {
+
+            // set "busy" cursor
+            GdkCursor *waiting = gdk_cursor_new(GDK_WATCH);
+            gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, waiting);
+
             sp_flood_do_flood_fill(event_context, event);
 
+            // restore cursor when done
+            gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
+            gdk_cursor_unref(waiting);
+
             ret = TRUE;
         }
         break;