mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
Call Window_DisableRawMouse on all platforms when game is closed, not just webclient (Thanks Igor1_)
Fixes on Windows where if cursor grabbing was enabled and the game window was closed via taskbar preview, the cursor would still be trapped/confined in the region the game window was in before the game was closed
This commit is contained in:
parent
a966f4b11b
commit
fc10386ff9
@ -624,6 +624,7 @@ void Game_Free(void* obj) {
|
||||
Logger_WarnFunc = Logger_DialogWarn;
|
||||
Gfx_Free();
|
||||
Options_SaveIfChanged();
|
||||
Window_DisableRawMouse();
|
||||
}
|
||||
|
||||
#define Game_DoFrameBody() \
|
||||
|
@ -497,6 +497,7 @@ static void DoCreateWindow(int width, int height) {
|
||||
Window_CommonCreate();
|
||||
WindowInfo.Exists = true;
|
||||
WindowInfo.Handle = win_handle;
|
||||
/* CGAssociateMouseAndMouseCursorPosition implicitly grabs cursor */
|
||||
|
||||
conn = _CGSDefaultConnection();
|
||||
winId = GetNativeWindowFromWindowRef(win_handle);
|
||||
|
@ -496,7 +496,6 @@ void Window_Close(void) {
|
||||
Window_ExitFullscreen();
|
||||
|
||||
/* Don't want cursor stuck on the dead 0,0 canvas */
|
||||
Window_DisableRawMouse();
|
||||
Window_SetSize(0, 0);
|
||||
UnhookEvents();
|
||||
/* Game_DoFrame doesn't do anything when WindowExists.False is false, */
|
||||
|
@ -283,6 +283,7 @@ static void DoCreateWindow(int width, int height) {
|
||||
Window_CommonCreate();
|
||||
WindowInfo.Exists = true;
|
||||
WindowInfo.Handle = winHandle;
|
||||
// CGAssociateMouseAndMouseCursorPosition implicitly grabs cursor
|
||||
|
||||
del = [CCWindowDelegate alloc];
|
||||
[winHandle setDelegate:del];
|
||||
|
Loading…
x
Reference in New Issue
Block a user