From 135ed1787db7cefffeb4032035c7eaa7618a57a2 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sat, 19 Jul 2008 02:20:47 +0000 Subject: [PATCH] a better way to make cursor change immediate; of course this trick is not documented by gdk, I just found it serendipitously when googling for some other code --- src/desktop.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/desktop.cpp b/src/desktop.cpp index 932d79ff2..0a7f353a8 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1275,14 +1275,9 @@ 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); + // GDK needs the flush for the cursor change to take effect + gdk_flush(); 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(); } void SPDesktop::clearWaitingCursor() -- 2.30.2