summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-10-19 12:46:09 +0200
committerCarlos Garnacho <carlosg@gnome.org>2022-10-19 13:21:21 +0200
commit9cc6f3c32c771443f22fe9ee8a1674cb39f6867d (patch)
tree490e64ce2feea435296ab0e87120cb250ac2fca2
parente037155a948cf6991356e66f29115470b3ccc3a4 (diff)
downloadgtk+-wip/carlosg/clipboard-serials.tar.gz
gdk/wayland: Use serial of the latest implicit grab availablewip/carlosg/clipboard-serials
When getting the serial for primary/clipboard selections we used a function that largely relied on a GdkEvent being passed. We have another available function that looks up the most recent serial given the ongoing touch/tablet input as well. This is the second best, compared to actually knowing the input/device from the event that was received by the UI an triggered the clipboard operation, and is already in use in other places (e.g. window dragging). It is valid for these situations too. Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5250
-rw-r--r--gdk/wayland/gdkdevice-wayland.c2
-rw-r--r--gdk/wayland/gdkprimary-wayland.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 98e08ecb5f..c6a3bacaa8 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -5323,7 +5323,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (gdk_device));
- serial = _gdk_wayland_seat_get_implicit_grab_serial (GDK_SEAT (seat), NULL);
+ serial = _gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL);
wl_data_device_set_selection (seat->data_device, source, serial);
}
diff --git a/gdk/wayland/gdkprimary-wayland.c b/gdk/wayland/gdkprimary-wayland.c
index 6cef2f3968..b501deb66b 100644
--- a/gdk/wayland/gdkprimary-wayland.c
+++ b/gdk/wayland/gdkprimary-wayland.c
@@ -292,7 +292,8 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
}
seat = gdk_display_get_default_seat (GDK_DISPLAY (wdisplay));
- serial = _gdk_wayland_seat_get_implicit_grab_serial (seat, NULL);
+ serial = _gdk_wayland_seat_get_last_implicit_grab_serial (GDK_WAYLAND_SEAT (seat),
+ NULL);
zwp_primary_selection_device_v1_set_selection (cb->primary_data_device,
cb->source,
serial);