xwayland/selection: destroy all selections on Xwayland restart

Previously, Xwayland could restart, and we'd get events for transfers
pointing to the previous (now freed) xwm instance. This led to
use-after-free segfaults.

Closes #2565.
This commit is contained in:
Tudor Brindus 2021-01-29 19:00:17 -05:00 committed by Simon Ser
parent 3417fc0cca
commit b6ba595862
3 changed files with 28 additions and 3 deletions

View file

@ -51,6 +51,9 @@ void xwm_selection_transfer_finish(struct wlr_xwm_selection_transfer *transfer);
bool xwm_selection_transfer_get_selection_property(
struct wlr_xwm_selection_transfer *transfer, bool delete);
void xwm_selection_transfer_destroy_outgoing(
struct wlr_xwm_selection_transfer *transfer);
xcb_atom_t xwm_mime_type_to_atom(struct wlr_xwm *xwm, char *mime_type);
char *xwm_mime_type_from_atom(struct wlr_xwm *xwm, xcb_atom_t atom);
struct wlr_xwm_selection *xwm_get_selection(struct wlr_xwm *xwm,