Skip to content

Commit

Permalink
fix xwayland clipboard crash (#1)
Browse files Browse the repository at this point in the history
Co-authored-by: Hideyuki Nagase <hideyukn@ntdev.microsoft.com>
  • Loading branch information
hideyukn88 and Hideyuki Nagase committed Apr 26, 2021
1 parent 86e7325 commit d71a8cf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions xwayland/selection.c
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

0 comments on commit d71a8cf

Please sign in to comment.