mirror of https://github.com/encounter/SDL.git
Fixed return value of SDL_GetGrabbedWindow() when we have an internal grab because of mouse relative mode
This commit is contained in:
parent
6aa1498b98
commit
629e9f820a
|
@ -2809,10 +2809,12 @@ SDL_GetWindowMouseGrab(SDL_Window * window)
|
|||
SDL_Window *
|
||||
SDL_GetGrabbedWindow(void)
|
||||
{
|
||||
SDL_assert(!_this->grabbed_window ||
|
||||
((_this->grabbed_window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0) ||
|
||||
((_this->grabbed_window->flags & SDL_WINDOW_KEYBOARD_GRABBED) != 0));
|
||||
if (_this->grabbed_window &&
|
||||
(_this->grabbed_window->flags & (SDL_WINDOW_MOUSE_GRABBED|SDL_WINDOW_KEYBOARD_GRABBED)) != 0) {
|
||||
return _this->grabbed_window;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in New Issue