diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-03-14 18:03:38 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-03-14 18:03:38 +0000 |
| commit | f0d27ba96ed690d8b6022fd2df4eb4cffeee614a (patch) | |
| tree | 5cc79741173c8aea56272882c664ababa5092987 | |
| parent | fix bug where master opacity did not affect markers (diff) | |
| download | inkscape-f0d27ba96ed690d8b6022fd2df4eb4cffeee614a.tar.gz inkscape-f0d27ba96ed690d8b6022fd2df4eb4cffeee614a.zip | |
add a flag and a setter method for busy cursor
(bzr r2646)
| -rw-r--r-- | src/desktop.cpp | 17 | ||||
| -rw-r--r-- | src/desktop.h | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index 5fa251842..668d46b31 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -54,6 +54,7 @@ #include <glibmm/i18n.h> #include <sigc++/functors/mem_fun.h> +#include <gtkmm.h> #include "macros.h" #include "inkscape-private.h" @@ -127,6 +128,7 @@ SPDesktop::SPDesktop() zooms_future = NULL; is_fullscreen = false; + waiting_cursor = false; gr_item = NULL; gr_point_type = 0; @@ -1070,6 +1072,21 @@ void SPDesktop::disableInteraction() _widget->disableInteraction(); } +void SPDesktop::setWaitingCursor() +{ + GdkCursor *waiting = gdk_cursor_new(GDK_WATCH); + gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(this))->window, waiting); + gdk_cursor_unref(waiting); + waiting_cursor = true; + + // Stupidly broken GDK cannot just set the new cursor right now - it needs some main loop iterations for that + // Since setting waiting_cursor is usually immediately followed by some Real Work, we must run the iterations here + // CAUTION: iterations may redraw, and redraw may be interrupted, so you cannot assume that anything is the same + // after the call to setWaitingCursor as it was before + while( Gtk::Main::events_pending() ) + Gtk::Main::iteration(); +} + //---------------------------------------------------------------------- // Callback implementations. The virtual ones are connected by the view. diff --git a/src/desktop.h b/src/desktop.h index 9f3d77520..fbc92b7a4 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -99,6 +99,7 @@ struct SPDesktop : public Inkscape::UI::View::View unsigned int number; bool is_fullscreen; unsigned int interaction_disabled_counter; + bool waiting_cursor; /// \todo fixme: This has to be implemented in different way */ guint guides_active : 1; @@ -240,6 +241,8 @@ struct SPDesktop : public Inkscape::UI::View::View void enableInteraction(); void disableInteraction(); + + void setWaitingCursor(); void fullscreen(); |
