[mutter/gnome-3-34] wayland: Shuffle wl_data_source.cancelled version checks on DnD
- From: Robert Mader <rmader src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-34] wayland: Shuffle wl_data_source.cancelled version checks on DnD
- Date: Sun, 19 Apr 2020 20:02:17 +0000 (UTC)
commit 668d13ffb56ca60801dc3f74b0115b7689bddd64
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Apr 16 21:06:15 2020 +0200
wayland: Shuffle wl_data_source.cancelled version checks on DnD
We are meant to send a .cancelled event after the drop is performed
in certain situations, but only for version>3 clients. Since this is
all version 3 business, only set the drop_performed flag for v3
clients. This drops the need to perform version checks at the time
of cancelling (which is present for other usecases in v1).
Fixes emission of wl_data_source.cancelled for v1 clients.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1177
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1203
(cherry picked from commit d4c3870286353e58d7e4c95111f1cdd354ba17ce)
src/wayland/meta-wayland-data-device.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index b289bc9bf..df3db0caa 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -1379,8 +1379,7 @@ meta_wayland_source_cancel (MetaWaylandDataSource *source)
if (!priv->resource)
return;
- if (wl_resource_get_version(priv->resource) >= WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION)
- wl_data_source_send_cancelled (priv->resource);
+ wl_data_source_send_cancelled (priv->resource);
}
static void
@@ -1401,11 +1400,12 @@ meta_wayland_source_drop_performed (MetaWaylandDataSource *source)
MetaWaylandDataSourcePrivate *priv =
meta_wayland_data_source_get_instance_private (source);
- priv->drop_performed = TRUE;
-
if (wl_resource_get_version (priv->resource) >=
WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION)
- wl_data_source_send_dnd_drop_performed (priv->resource);
+ {
+ priv->drop_performed = TRUE;
+ wl_data_source_send_dnd_drop_performed (priv->resource);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]