From 45f5e536ecc4a2b3d51434eeae698ab2ab7df697 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 15 Aug 2019 14:02:22 +0200 Subject: [PATCH] Fix a crash when closing an X11 window with a selection This was caused by weston_wm_handle_xfixes_selection_notify() calling weston_seat_set_selection() with a NULL source, apparently only sometimes when closing an Xwayland window. --- libweston/data-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libweston/data-device.c b/libweston/data-device.c index e19409fc4..865d74979 100644 --- a/libweston/data-device.c +++ b/libweston/data-device.c @@ -1152,7 +1152,9 @@ weston_seat_set_selection(struct weston_seat *seat, seat->selection_data_source = source; seat->selection_serial = serial; - source->set_selection = true; + + if (source) + source->set_selection = true; if (keyboard) focus = keyboard->focus;