From 2f2620215ef8c5f69dc9f086925354624ffd9868 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 1 Sep 2006 21:44:22 +0000 Subject: [PATCH] call GTKUpdateCursor() from SetCursor() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/window.h | 2 +- src/gtk/window.cpp | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index fa4e459279..87003b1e69 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -353,7 +353,7 @@ protected: // set the current cursor for all GdkWindows making part of this widget // (see GTKGetWindow) -public: + // // should be called from OnInternalIdle() if it's overridden void GTKUpdateCursor(); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 65b0886c75..d9e6c89951 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1730,7 +1730,6 @@ gtk_window_motion_notify_callback( GtkWidget *widget, { // Rewrite cursor handling here (away from idle). win->SetCursor( cevent.GetCursor() ); - win->GTKUpdateCursor(); } } @@ -1947,7 +1946,6 @@ gtk_window_enter_callback( GtkWidget *widget, { // Rewrite cursor handling here (away from idle). win->SetCursor( cevent.GetCursor() ); - win->GTKUpdateCursor(); } } @@ -3536,15 +3534,12 @@ void wxWindowGTK::Lower() bool wxWindowGTK::SetCursor( const wxCursor &cursor ) { - wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") ); - - if (cursor == m_cursor) - return false; + if ( !wxWindowBase::SetCursor( cursor.Ok() ? cursor : *wxSTANDARD_CURSOR) ) + return false; - if (g_isIdle) - wxapp_install_idle_handler(); + GTKUpdateCursor(); - return wxWindowBase::SetCursor( cursor.Ok() ? cursor : *wxSTANDARD_CURSOR ); + return true; } void wxWindowGTK::GTKUpdateCursor() -- 2.45.2