mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-10 13:29:44 -05:00
data-device: destroy previous source when starting drag
This supersedesf24e17259eand04c9ca4198. These commits were manually removing wlr_data_source destroy handlers when starting a new drag. This is error-prone. Instead, this commit destroys the previous source whenever we start a new drag.
This commit is contained in:
parent
b2f56ad4a8
commit
556bf3ac31
2 changed files with 4 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue