From cca602accb6910cd68cc7181b0a4a80f03a0b444 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 20 Mar 2000 10:53:04 +0000 Subject: [PATCH] Fixed problem with CaptureMouse if cursor is null. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 6 +++++- src/gtk1/window.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 11ac0f1d55..80384e2535 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3422,6 +3422,10 @@ void wxWindow::CaptureMouse() if (!window) return; + wxCursor* cursor = & m_cursor; + if (!cursor->Ok()) + cursor = wxSTANDARD_CURSOR; + gdk_pointer_grab( window, FALSE, (GdkEventMask) (GDK_BUTTON_PRESS_MASK | @@ -3429,7 +3433,7 @@ void wxWindow::CaptureMouse() GDK_POINTER_MOTION_HINT_MASK | GDK_POINTER_MOTION_MASK), (GdkWindow *) NULL, - m_cursor.GetCursor(), + cursor->GetCursor(), (guint32)GDK_CURRENT_TIME ); g_captureWindow = this; } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 11ac0f1d55..80384e2535 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -3422,6 +3422,10 @@ void wxWindow::CaptureMouse() if (!window) return; + wxCursor* cursor = & m_cursor; + if (!cursor->Ok()) + cursor = wxSTANDARD_CURSOR; + gdk_pointer_grab( window, FALSE, (GdkEventMask) (GDK_BUTTON_PRESS_MASK | @@ -3429,7 +3433,7 @@ void wxWindow::CaptureMouse() GDK_POINTER_MOTION_HINT_MASK | GDK_POINTER_MOTION_MASK), (GdkWindow *) NULL, - m_cursor.GetCursor(), + cursor->GetCursor(), (guint32)GDK_CURRENT_TIME ); g_captureWindow = this; } -- 2.47.2