mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
wayland: Remove focus references when a pointer capture ends on a subsurface
The core mouse code will unfocus the window when a capture ends outside the window boundaries, but the backend still needs to update the internal focus references.
This commit is contained in:
parent
3626598675
commit
0a96d47599
1 changed files with 5 additions and 0 deletions
|
|
@ -1048,6 +1048,11 @@ static void pointer_dispatch_button(SDL_WaylandSeat *seat, Uint8 sdl_button, boo
|
|||
window->sdlwindow->flags |= SDL_WINDOW_MOUSE_CAPTURE;
|
||||
} else {
|
||||
window->sdlwindow->flags &= ~SDL_WINDOW_MOUSE_CAPTURE;
|
||||
|
||||
// If ending the capture on a subsurface, dispatch a leave event to remove focus.
|
||||
if (seat->pointer.focus_surface != window->surface) {
|
||||
seat->pointer.pending_frame.leave_surface = window->surface;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue