summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/wayland/wayland_thread.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-09-08 23:22:26 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-09-08 23:22:26 +0200
commitd0dc3896ad6fe039e4ad0607d901c81197cb3a3b (patch)
tree53c22863a512e95fc8d331838bbdcc02c2ae2c23 /platform/linuxbsd/wayland/wayland_thread.cpp
parentd0c9023b5143153d4f2c4b8b9772f8ce335c3520 (diff)
parent26d89bc8e9999920ce85356e35262dab3e6412f7 (diff)
downloadredot-engine-d0dc3896ad6fe039e4ad0607d901c81197cb3a3b.tar.gz
Merge pull request #96714 from Riteo/dont-ask-me-why-they-are-different
Wayland: Make primary selection logic consistent with main clipboard
Diffstat (limited to 'platform/linuxbsd/wayland/wayland_thread.cpp')
-rw-r--r--platform/linuxbsd/wayland/wayland_thread.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp
index ab13105d18..66be313ff6 100644
--- a/platform/linuxbsd/wayland/wayland_thread.cpp
+++ b/platform/linuxbsd/wayland/wayland_thread.cpp
@@ -169,12 +169,13 @@ Vector<uint8_t> WaylandThread::_wp_primary_selection_offer_read(struct wl_displa
int fds[2];
if (pipe(fds) == 0) {
- // This function expects to return a string, so we can only ask for a MIME of
- // "text/plain"
zwp_primary_selection_offer_v1_receive(p_offer, p_mime, fds[1]);
- // Wait for the compositor to know about the pipe.
- wl_display_roundtrip(p_display);
+ // NOTE: It's important to just flush and not roundtrip here as we would risk
+ // running some cleanup event, like for example `wl_data_device::leave`. We're
+ // going to wait for the message anyways as the read will probably block if
+ // the compositor doesn't read from the other end of the pipe.
+ wl_display_flush(p_display);
// Close the write end of the pipe, which we don't need and would otherwise
// just stall our next `read`s.