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
This commit is contained in:
Paul Cornett 2014-11-15 17:02:21 +00:00
parent 00cc0233f6
commit dc555a92e3
2 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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()
{