Skip to content

Commit

Permalink
Merge pull request godotengine#96714 from Riteo/dont-ask-me-why-they-…
Browse files Browse the repository at this point in the history
…are-different

Wayland: Make primary selection logic consistent with main clipboard
  • Loading branch information
akien-mga committed Sep 8, 2024
2 parents d0c9023 + 26d89bc commit d0dc389
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions platform/linuxbsd/wayland/wayland_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d0dc389

Please sign in to comment.