From 2f4a10913b2df3de5279aec58a3bf758b58f3194 Mon Sep 17 00:00:00 2001 From: Matthew Coppola Date: Sat, 2 Nov 2019 23:43:25 -0400 Subject: [PATCH] SDL2: Hide mouse cursor when menu is not active --- SDL/gui.c | 1 + SDL/main.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/SDL/gui.c b/SDL/gui.c index 6cffeaf..b34bb1a 100644 --- a/SDL/gui.c +++ b/SDL/gui.c @@ -792,6 +792,7 @@ void connect_joypad(void) void run_gui(bool is_running) { + SDL_ShowCursor(SDL_ENABLE); connect_joypad(); /* Draw the background screen */ diff --git a/SDL/main.c b/SDL/main.c index ba2a5fb..d96ee1b 100755 --- a/SDL/main.c +++ b/SDL/main.c @@ -98,6 +98,7 @@ static void open_menu(void) SDL_PauseAudioDevice(device_id, 1); } run_gui(true); + SDL_ShowCursor(SDL_DISABLE); if (audio_playing) { SDL_ClearQueuedAudio(device_id); SDL_PauseAudioDevice(device_id, 0); @@ -425,6 +426,7 @@ static bool handle_pending_command(void) static void run(void) { + SDL_ShowCursor(SDL_DISABLE); GB_model_t model; pending_command = GB_SDL_NO_COMMAND; restart: