diff options
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | types/data_device/wlr_drag.c | 3 | ||||
-rw-r--r-- | xwayland/selection/dnd.c | 5 |
3 files changed, 9 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 3284d5ca..4d68bd6c 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'wlroots', 'c', - version: '0.2.0', + version: '0.3.0', license: 'MIT', meson_version: '>=0.48.0', default_options: [ diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c index 9bd63d96..2b676fdc 100644 --- a/types/data_device/wlr_drag.c +++ b/types/data_device/wlr_drag.c @@ -490,6 +490,9 @@ bool seat_client_start_drag(struct wlr_seat_client *client, seat->drag = drag; // TODO: unset this thing somewhere seat->drag_serial = serial; + if (seat->drag_source != NULL) { + wl_list_remove(&seat->drag_source_destroy.link); + } seat->drag_source = source; if (source != NULL) { seat->drag_source_destroy.notify = seat_handle_drag_source_destroy; diff --git a/xwayland/selection/dnd.c b/xwayland/selection/dnd.c index ec5f16c7..fc090936 100644 --- a/xwayland/selection/dnd.c +++ b/xwayland/selection/dnd.c @@ -315,6 +315,8 @@ static void seat_handle_drag_source_destroy(struct wl_listener *listener, wl_container_of(listener, xwm, seat_drag_source_destroy); wl_list_remove(&xwm->seat_drag_source_destroy.link); + xwm->seat_drag_source_destroy.link.prev = NULL; + xwm->seat_drag_source_destroy.link.next = NULL; xwm->drag_focus = NULL; } @@ -332,6 +334,9 @@ void xwm_seat_handle_start_drag(struct wlr_xwm *xwm, struct wlr_drag *drag) { wl_signal_add(&drag->events.destroy, &xwm->seat_drag_destroy); xwm->seat_drag_destroy.notify = seat_handle_drag_destroy; + if (xwm->seat_drag_source_destroy.link.prev != NULL) { + wl_list_remove(&xwm->seat_drag_source_destroy.link); + } wl_signal_add(&drag->source->events.destroy, &xwm->seat_drag_source_destroy); xwm->seat_drag_source_destroy.notify = seat_handle_drag_source_destroy; |