From dc555a92e326d5fcabbd356198066a765d36e1c6 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 15 Nov 2014 17:02:21 +0000 Subject: [PATCH] notify all windows in capture stack about capture lost, and empty the stack git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/window.h | 1 + src/gtk/window.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index 4db8b9d73f..13683f64de 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -187,6 +187,7 @@ public: // This is called when capture is taken from the window. It will // fire off capture lost events. void GTKReleaseMouseAndNotify(); + static void GTKHandleCaptureLost(); GdkWindow* GTKGetDrawingWindow() const; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 7f6584af6a..321d6816cb 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2070,7 +2070,7 @@ size_allocate(GtkWidget*, GtkAllocation* alloc, wxWindow* win) } //----------------------------------------------------------------------------- -// "grab_broken" +// "grab_broken_event" //----------------------------------------------------------------------------- #if GTK_CHECK_VERSION(2, 8, 0) @@ -2082,9 +2082,7 @@ gtk_window_grab_broken( GtkWidget*, // Mouse capture has been lost involuntarily, notify the application if(!event->keyboard && wxWindow::GetCapture() == win) { - wxMouseCaptureLostEvent evt( win->GetId() ); - evt.SetEventObject( win ); - win->HandleWindowEvent( evt ); + wxWindowGTK::GTKHandleCaptureLost(); } return false; } @@ -4852,6 +4850,12 @@ void wxWindowGTK::GTKReleaseMouseAndNotify() NotifyCaptureLost(); } +void wxWindowGTK::GTKHandleCaptureLost() +{ + g_captureWindow = NULL; + NotifyCaptureLost(); +} + /* static */ wxWindow *wxWindowBase::GetCapture() {