From: buliabyak Date: Wed, 14 Mar 2007 18:05:25 +0000 (+0000) Subject: use desktop method to set waiting cursor; do not try to restore it if someone already... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=63a173e5f41b6f886b3bea32a5b4df6e8fe9e875;p=inkscape.git 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) --- 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; }