00cc023
"fix releasing mouse capture before showing modal dialog"dc555a9
"notify all windows in capture stack about capture lost, and empty the stack" closes #16647
This commit is contained in:
@@ -2030,9 +2030,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;
|
||||
}
|
||||
@@ -4799,10 +4797,22 @@ void wxWindowGTK::DoReleaseMouse()
|
||||
|
||||
void wxWindowGTK::GTKReleaseMouseAndNotify()
|
||||
{
|
||||
DoReleaseMouse();
|
||||
wxMouseCaptureLostEvent evt(GetId());
|
||||
evt.SetEventObject( this );
|
||||
HandleWindowEvent( evt );
|
||||
GdkDisplay* display = gtk_widget_get_display(m_widget);
|
||||
#ifdef __WXGTK3__
|
||||
GdkDeviceManager* manager = gdk_display_get_device_manager(display);
|
||||
GdkDevice* device = gdk_device_manager_get_client_pointer(manager);
|
||||
gdk_device_ungrab(device, unsigned(GDK_CURRENT_TIME));
|
||||
#else
|
||||
gdk_display_pointer_ungrab(display, unsigned(GDK_CURRENT_TIME));
|
||||
#endif
|
||||
g_captureWindow = NULL;
|
||||
NotifyCaptureLost();
|
||||
}
|
||||
|
||||
void wxWindowGTK::GTKHandleCaptureLost()
|
||||
{
|
||||
g_captureWindow = NULL;
|
||||
NotifyCaptureLost();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
Reference in New Issue
Block a user