Merge pull request #1529 from emersion/better-dnd-fix

data-device: destroy previous source when starting drag
This commit is contained in:
Drew DeVault 2019-02-06 14:39:55 +01:00 committed by GitHub
commit 20d404a091
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View file

@ -487,12 +487,12 @@ bool seat_client_start_drag(struct wlr_seat_client *client,
drag_set_focus(drag, point->surface, point->sx, point->sy);
}
seat->drag = drag; // TODO: unset this thing somewhere
seat->drag = drag;
seat->drag_serial = serial;
if (seat->drag_source != NULL) {
wl_list_remove(&seat->drag_source_destroy.link);
}
// We need to destroy the previous source, because listeners only expect one
// active drag source at a time.
wlr_data_source_destroy(seat->drag_source);
seat->drag_source = source;
if (source != NULL) {
seat->drag_source_destroy.notify = seat_handle_drag_source_destroy;