mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
wayland: Dispatch pointer leave when destroying the pointer or a surface
No pointer frame event will occur when synthesizing a leave event, so dispatch immediately.
This commit is contained in:
parent
55acc0b829
commit
ca537d651b
1 changed files with 8 additions and 2 deletions
|
|
@ -2407,7 +2407,9 @@ static void Wayland_SeatDestroyPointer(SDL_WaylandSeat *seat)
|
|||
|
||||
// Make sure focus is removed from a surface before the pointer is destroyed.
|
||||
if (seat->pointer.focus) {
|
||||
pointer_handle_leave(seat, seat->pointer.wl_pointer, 0, seat->pointer.focus->surface);
|
||||
seat->pointer.pending_frame.leave_window = seat->pointer.focus;
|
||||
pointer_dispatch_leave(seat);
|
||||
seat->pointer.pending_frame.leave_window = NULL;
|
||||
}
|
||||
|
||||
SDL_RemoveMouse(seat->pointer.sdl_id);
|
||||
|
|
@ -3675,7 +3677,11 @@ void Wayland_DisplayRemoveWindowReferencesFromSeats(SDL_VideoData *display, SDL_
|
|||
}
|
||||
|
||||
if (seat->pointer.focus == window) {
|
||||
pointer_handle_leave(seat, seat->pointer.wl_pointer, 0, window->surface);
|
||||
seat->pointer.pending_frame.leave_window = seat->pointer.focus;
|
||||
pointer_dispatch_leave(seat);
|
||||
Wayland_SeatUpdatePointerGrab(seat);
|
||||
Wayland_SeatUpdatePointerCursor(seat);
|
||||
seat->pointer.pending_frame.leave_window = NULL;
|
||||
}
|
||||
|
||||
// Need the safe loop variant here as cancelling a touch point removes it from the list.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue