summaryrefslogtreecommitdiffstats
path: root/src/flood-context.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-03-14 18:05:25 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-03-14 18:05:25 +0000
commit42ad97e12382014d9422855f780cec1d6d7241eb (patch)
treef5454b18fb052ff2f54be67a395057795a00071e /src/flood-context.cpp
parentreset waiting_cursor when setting any other (diff)
downloadinkscape-42ad97e12382014d9422855f780cec1d6d7241eb.tar.gz
inkscape-42ad97e12382014d9422855f780cec1d6d7241eb.zip
use desktop method to set waiting cursor; do not try to restore it if someone already did it (fixes crash when you switch to another tool while filling)
(bzr r2648)
Diffstat (limited to 'src/flood-context.cpp')
-rw-r--r--src/flood-context.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/flood-context.cpp b/src/flood-context.cpp
index e20fa1339..367e56a3d 100644
--- a/src/flood-context.cpp
+++ b/src/flood-context.cpp
@@ -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;
}