mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
wayland: Check resource before emitting cancelled event
If a data source is destroyed we first unset the resource, and then try to unref the related selection source. At this point the only event that might be emitted by the internal selection machinery is .cancelled, so make sure we avoid it on destroyed sources. Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/842
This commit is contained in:
@ -1369,7 +1369,8 @@ meta_wayland_source_cancel (MetaWaylandDataSource *source)
|
||||
MetaWaylandDataSourceWayland *source_wayland =
|
||||
META_WAYLAND_DATA_SOURCE_WAYLAND (source);
|
||||
|
||||
wl_data_source_send_cancelled (source_wayland->resource);
|
||||
if (source_wayland->resource)
|
||||
wl_data_source_send_cancelled (source_wayland->resource);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1464,7 +1465,8 @@ meta_wayland_data_source_primary_cancel (MetaWaylandDataSource *source)
|
||||
MetaWaylandDataSourceWayland *source_wayland;
|
||||
|
||||
source_wayland = META_WAYLAND_DATA_SOURCE_WAYLAND (source);
|
||||
gtk_primary_selection_source_send_cancelled (source_wayland->resource);
|
||||
if (source_wayland->resource)
|
||||
gtk_primary_selection_source_send_cancelled (source_wayland->resource);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user