Code

use desktop method to set waiting cursor; do not try to restore it if someone already...
authorbuliabyak <buliabyak@users.sourceforge.net>
Wed, 14 Mar 2007 18:05:25 +0000 (18:05 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Wed, 14 Mar 2007 18:05:25 +0000 (18:05 +0000)
src/flood-context.cpp

index e20fa1339beaedf59089e28976846ea4fabac750..367e56a3dd1af334cb827223c2611d1b25f1c029 100644 (file)
@@ -778,14 +778,14 @@ static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEven
         if ( event->button.button == 1 ) {
             if (!(event->button.state & GDK_CONTROL_MASK)) {
                 // set "busy" cursor
-                GdkCursor *waiting = gdk_cursor_new(GDK_WATCH);
-                gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, waiting);
+                desktop->setWaitingCursor();
     
                 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);
+                // restore cursor when done; note that it may already be different if e.g. user 
+                // switched to another tool during interruptible tracing or drawing, in which case do nothing
+                if (desktop->waiting_cursor)
+                    sp_event_context_update_cursor(event_context);
     
                 ret = TRUE;
             }