mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +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:
parent
e53db92a7b
commit
227d272049
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user