broadway: Unsure we clear the grab on window hide

This commit is contained in:
Alexander Larsson 2013-04-05 17:06:09 +02:00
parent a6a768437d
commit 9a79c3d643
3 changed files with 29 additions and 0 deletions

View File

@ -211,6 +211,29 @@ gdk_broadway_device_query_state (GdkDevice *device,
return;
}
void
_gdk_broadway_window_grab_check_unmap (GdkWindow *window,
gulong serial)
{
GdkDisplay *display = gdk_window_get_display (window);
GdkDeviceManager *device_manager;
GList *devices, *d;
device_manager = gdk_display_get_device_manager (display);
/* Get all devices */
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE));
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING));
/* End all grabs on the newly hidden window */
for (d = devices; d; d = d->next)
_gdk_display_end_device_grab (display, d->data, serial, window, TRUE);
g_list_free (devices);
}
void
_gdk_broadway_window_grab_check_destroy (GdkWindow *window)
{

View File

@ -92,6 +92,8 @@ gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
void _gdk_broadway_selection_window_destroyed (GdkWindow *window);
void _gdk_broadway_window_grab_check_destroy (GdkWindow *window);
void _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
gulong serial);
void _gdk_keymap_keys_changed (GdkDisplay *display);
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,

View File

@ -437,6 +437,10 @@ gdk_window_broadway_hide (GdkWindow *window)
_gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE);
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
_gdk_broadway_window_grab_check_unmap (window,
_gdk_broadway_server_get_next_serial (broadway_display->server));
if (_gdk_broadway_server_window_hide (broadway_display->server, impl->id))
queue_flush (window);