xwayland: Allow dump_property when selection fails

dump_property allows reply to be NULL.  Calling it unconditionally will
ensure user knows where the selection failed.

Also refactor code a bit.

Suggested by Marek Chalupa
dev
Bryce Harrington 9 years ago
parent b2d79d504e
commit da41b5739d
  1. 10
      xwayland/selection.c

@ -240,14 +240,14 @@ weston_wm_get_selection_data(struct weston_wm *wm)
0x1fffffff /* length */);
reply = xcb_get_property_reply(wm->conn, cookie, NULL);
if (reply == NULL)
return;
if (reply->type == wm->atom.incr) {
dump_property(wm, wm->atom.wl_selection, reply);
dump_property(wm, wm->atom.wl_selection, reply);
if (reply == NULL) {
return;
} else if (reply->type == wm->atom.incr) {
wm->incr = 1;
} else {
dump_property(wm, wm->atom.wl_selection, reply);
wm->incr = 0;
weston_wm_write_property(wm, reply);
}

Loading…
Cancel
Save