mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Add a test case for bug https://github.com/libsdl-org/SDL/issues/4469
This commit is contained in:
parent
c72aef2664
commit
7df6a9ea59
@ -38,6 +38,7 @@ static const char *cursorNames[] = {
|
|||||||
};
|
};
|
||||||
int system_cursor = -1;
|
int system_cursor = -1;
|
||||||
SDL_Cursor *cursor = NULL;
|
SDL_Cursor *cursor = NULL;
|
||||||
|
SDL_bool relative_mode = SDL_FALSE;
|
||||||
|
|
||||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||||
static void
|
static void
|
||||||
@ -76,6 +77,17 @@ loop()
|
|||||||
SDL_GetDisplayName(SDL_GetWindowDisplayIndex(window)));
|
SDL_GetDisplayName(SDL_GetWindowDisplayIndex(window)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) {
|
||||||
|
relative_mode = SDL_GetRelativeMouseMode();
|
||||||
|
if (relative_mode) {
|
||||||
|
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) {
|
||||||
|
if (relative_mode) {
|
||||||
|
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (event.type == SDL_KEYUP) {
|
if (event.type == SDL_KEYUP) {
|
||||||
SDL_bool updateCursor = SDL_FALSE;
|
SDL_bool updateCursor = SDL_FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user