Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix xwayland clipboard crash #1

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions xwayland/selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,11 @@ weston_wm_read_data_source(int fd, uint32_t mask, void *data)
return 1;
}

weston_log("read %d (available %d, mask 0x%x) bytes: \"%.*s\"\n",
len, available, mask, len, (char *) p);
weston_log("read %d (available %d, mask 0x%x)\n",
len, available, mask);
/*remove actual data due to privacy*/
/*weston_log("read %d (available %d, mask 0x%x) bytes: \"%.*s\"\n",
len, available, mask, len, (char *) p);*/

wm->source_data.size = current + len;
if (wm->source_data.size >= incr_chunk_size) {
Expand Down Expand Up @@ -496,6 +499,11 @@ weston_wm_send_data(struct weston_wm *wm, xcb_atom_t target, const char *mime_ty
struct weston_seat *seat = weston_wm_pick_seat(wm);
int p[2];

if (wm->property_source) {
weston_log("outstanding selection exist\n");
return;
}

if (pipe2(p, O_CLOEXEC | O_NONBLOCK) == -1) {
weston_log("pipe2 failed: %s\n", strerror(errno));
weston_wm_send_selection_notify(wm, XCB_ATOM_NONE);
Expand Down