summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc536fb)
raw | patch | inline | side by side (parent: fc536fb)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 14 Mar 2007 18:03:38 +0000 (18:03 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 14 Mar 2007 18:03:38 +0000 (18:03 +0000) |
src/desktop.cpp | patch | blob | history | |
src/desktop.h | patch | blob | history |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 5fa251842cdb926d16176aac62ce0a23f0c4a76c..668d46b31cfbca8505ba3302202ed1c85df40517 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
#include <glibmm/i18n.h>
#include <sigc++/functors/mem_fun.h>
+#include <gtkmm.h>
#include "macros.h"
#include "inkscape-private.h"
zooms_future = NULL;
is_fullscreen = false;
+ waiting_cursor = false;
gr_item = NULL;
gr_point_type = 0;
_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 9f3d7752076f34d021df00c841538df9be4a5b52..fbc92b7a4e76dcbb94392b48e13052556f18b77a 100644 (file)
--- a/src/desktop.h
+++ b/src/desktop.h
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;
void enableInteraction();
void disableInteraction();
+
+ void setWaitingCursor();
void fullscreen();