From 97575fa7a49b73bbe3996405aa0c4fd8509db8b1 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 28 Jan 2021 21:32:25 +0100 Subject: [PATCH] (macOS) Fixed an issue where the mouse cursor would jump to the Dock on startup. --- es-app/src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index acc5e61e9..5ad9ab750 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -469,7 +469,10 @@ int main(int argc, char* argv[]) return 1; // This hides the mouse cursor during startup, i.e. before we have begun to capture SDL events. + // On macOS this causes the mouse cursor to jump back to the Dock so don't do it on this OS. + #if !defined(__APPLE__) SDL_SetRelativeMouseMode(SDL_TRUE); + #endif AudioManager::getInstance(); MameNames::init(); @@ -602,7 +605,9 @@ int main(int argc, char* argv[]) bool running = true; // Now that we've finished loading, disable the relative mouse mode or otherwise mouse // input wouldn't work in any games that are launched. + #if !defined(__APPLE__) SDL_SetRelativeMouseMode(SDL_FALSE); + #endif while (running) { if (SDL_PollEvent(&event)) {