Fix the mouse cursor being constrained after leaving fullscreen.

This commit is contained in:
Alexander Babikov
2020-11-09 04:14:05 +05:00
parent 2d8f97ce64
commit a9bc8b7bb4

View File

@@ -326,7 +326,7 @@ sdl_init_common(int flags)
wchar_t temp[128];
SDL_version ver;
int w = 0, h = 0, x = 0, y = 0;
RECT rect;
RECT rect, oldclip;
sdl_log("SDL: init (fs=%d)\n", fs);
@@ -389,6 +389,8 @@ sdl_init_common(int flags)
/* Now create the SDL window from that. */
sdl_win = SDL_CreateWindowFrom((void *)sdl_hwnd);
GetClipCursor(&oldclip);
old_capture = mouse_capture;
GetWindowRect(sdl_hwnd, &rect);
@@ -406,6 +408,8 @@ sdl_init_common(int flags)
GetWindowRect(hwndRender, &rect);
ClipCursor(&rect);
} else {
ClipCursor(&oldclip);
}
}
if (sdl_win == NULL) {