mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
compositor: End MetaDnd grab on plugin grab end
We must emit ::dnd-leave to pair the ::dnd-enter that shall be emitted whenever the plugin grab begins, otherwise we leave listeners unable to clean up if the plugin begins and ends a grab while there is an ongoing DnD operation. https://bugzilla.gnome.org/show_bug.cgi?id=784545
This commit is contained in:
parent
989a47ee8c
commit
d0531966eb
@ -29,6 +29,7 @@ gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
void meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor);
|
||||
void meta_dnd_wayland_handle_end_modal (MetaCompositor *compositor);
|
||||
#endif
|
||||
|
||||
#endif /* META_DND_PRIVATE_H */
|
||||
|
@ -420,7 +420,10 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
|
||||
meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp);
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
meta_dnd_wayland_handle_end_modal (compositor);
|
||||
meta_display_sync_wayland_input_focus (display);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -218,20 +218,9 @@ meta_dnd_wayland_end_notify (ClutterActor *actor,
|
||||
MetaDnd *dnd)
|
||||
{
|
||||
MetaDndPrivate *priv = meta_dnd_get_instance_private (dnd);
|
||||
unsigned int i;
|
||||
|
||||
meta_wayland_data_device_end_drag (&priv->wl_compositor->seat->data_device);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (priv->handler_id); i++)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->compositor->stage, priv->handler_id[i]);
|
||||
priv->handler_id[i] = 0;
|
||||
}
|
||||
|
||||
priv->compositor = NULL;
|
||||
priv->wl_compositor = NULL;
|
||||
|
||||
meta_dnd_notify_dnd_leave (dnd);
|
||||
meta_dnd_wayland_handle_end_modal (priv->compositor);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -286,4 +275,27 @@ meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor)
|
||||
meta_dnd_notify_dnd_enter (dnd);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_dnd_wayland_handle_end_modal (MetaCompositor *compositor)
|
||||
{
|
||||
MetaWaylandCompositor *wl_compositor = meta_wayland_compositor_get_default ();
|
||||
MetaDnd *dnd = meta_backend_get_dnd (meta_get_backend ());
|
||||
MetaDndPrivate *priv = meta_dnd_get_instance_private (dnd);
|
||||
unsigned int i;
|
||||
|
||||
if (!priv->compositor)
|
||||
return;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (priv->handler_id); i++)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->compositor->stage, priv->handler_id[i]);
|
||||
priv->handler_id[i] = 0;
|
||||
}
|
||||
|
||||
priv->compositor = NULL;
|
||||
priv->wl_compositor = NULL;
|
||||
|
||||
meta_dnd_notify_dnd_leave (dnd);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user