File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
platform/linuxbsd/wayland Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,13 @@ Vector<uint8_t> WaylandThread::_wp_primary_selection_offer_read(struct wl_displa
169169
170170 int fds[2 ];
171171 if (pipe (fds) == 0 ) {
172- // This function expects to return a string, so we can only ask for a MIME of
173- // "text/plain"
174172 zwp_primary_selection_offer_v1_receive (p_offer, p_mime, fds[1 ]);
175173
176- // Wait for the compositor to know about the pipe.
177- wl_display_roundtrip (p_display);
174+ // NOTE: It's important to just flush and not roundtrip here as we would risk
175+ // running some cleanup event, like for example `wl_data_device::leave`. We're
176+ // going to wait for the message anyways as the read will probably block if
177+ // the compositor doesn't read from the other end of the pipe.
178+ wl_display_flush (p_display);
178179
179180 // Close the write end of the pipe, which we don't need and would otherwise
180181 // just stall our next `read`s.
You can’t perform that action at this time.
0 commit comments