mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
bugfix: dnd force cancel
This commit is contained in:
parent
e903a69698
commit
1a756b3123
6 changed files with 40 additions and 15 deletions
|
|
@ -432,18 +432,23 @@ static void wlr_drag_set_focus(struct wlr_drag *drag,
|
|||
}
|
||||
|
||||
static void wlr_drag_end(struct wlr_drag *drag) {
|
||||
if (drag->icon) {
|
||||
wl_list_remove(&drag->icon_destroy.link);
|
||||
}
|
||||
if (!drag->cancelling) {
|
||||
drag->cancelling = true;
|
||||
wlr_seat_pointer_end_grab(drag->pointer_grab.seat);
|
||||
wlr_seat_keyboard_end_grab(drag->keyboard_grab.seat);
|
||||
|
||||
if (drag->source) {
|
||||
wl_list_remove(&drag->source_destroy.link);
|
||||
}
|
||||
if (drag->source) {
|
||||
wl_list_remove(&drag->source_destroy.link);
|
||||
}
|
||||
|
||||
wlr_drag_set_focus(drag, NULL, 0, 0);
|
||||
wlr_seat_pointer_end_grab(drag->pointer_grab.seat);
|
||||
wlr_seat_keyboard_end_grab(drag->keyboard_grab.seat);
|
||||
free(drag);
|
||||
wlr_drag_set_focus(drag, NULL, 0, 0);
|
||||
|
||||
if (drag->icon) {
|
||||
wl_list_remove(&drag->icon_destroy.link);
|
||||
}
|
||||
|
||||
free(drag);
|
||||
}
|
||||
}
|
||||
|
||||
static void pointer_drag_enter(struct wlr_seat_pointer_grab *grab,
|
||||
|
|
@ -588,8 +593,6 @@ static bool seat_client_start_drag(struct wlr_seat_client *client,
|
|||
wlr_seat_keyboard_start_grab(seat, &drag->keyboard_grab);
|
||||
wlr_seat_pointer_start_grab(seat, &drag->pointer_grab);
|
||||
|
||||
// TODO keyboard grab
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -547,6 +547,9 @@ void wlr_seat_pointer_end_grab(struct wlr_seat *wlr_seat) {
|
|||
if (grab != wlr_seat->pointer_state.default_grab) {
|
||||
wlr_seat->pointer_state.grab = wlr_seat->pointer_state.default_grab;
|
||||
wl_signal_emit(&wlr_seat->events.pointer_grab_end, grab);
|
||||
if (grab->interface->cancel) {
|
||||
grab->interface->cancel(grab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -665,6 +668,9 @@ void wlr_seat_keyboard_end_grab(struct wlr_seat *wlr_seat) {
|
|||
if (grab != wlr_seat->keyboard_state.default_grab) {
|
||||
wlr_seat->keyboard_state.grab = wlr_seat->keyboard_state.default_grab;
|
||||
wl_signal_emit(&wlr_seat->events.keyboard_grab_end, grab);
|
||||
if (grab->interface->cancel) {
|
||||
grab->interface->cancel(grab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue