SDL2: Hide mouse cursor when menu is not active

This commit is contained in:
Matthew Coppola 2019-11-02 23:43:25 -04:00
parent 70542137f2
commit 2f4a10913b
2 changed files with 3 additions and 0 deletions

View File

@ -792,6 +792,7 @@ void connect_joypad(void)
void run_gui(bool is_running) void run_gui(bool is_running)
{ {
SDL_ShowCursor(SDL_ENABLE);
connect_joypad(); connect_joypad();
/* Draw the background screen */ /* Draw the background screen */

View File

@ -98,6 +98,7 @@ static void open_menu(void)
SDL_PauseAudioDevice(device_id, 1); SDL_PauseAudioDevice(device_id, 1);
} }
run_gui(true); run_gui(true);
SDL_ShowCursor(SDL_DISABLE);
if (audio_playing) { if (audio_playing) {
SDL_ClearQueuedAudio(device_id); SDL_ClearQueuedAudio(device_id);
SDL_PauseAudioDevice(device_id, 0); SDL_PauseAudioDevice(device_id, 0);
@ -425,6 +426,7 @@ static bool handle_pending_command(void)
static void run(void) static void run(void)
{ {
SDL_ShowCursor(SDL_DISABLE);
GB_model_t model; GB_model_t model;
pending_command = GB_SDL_NO_COMMAND; pending_command = GB_SDL_NO_COMMAND;
restart: restart: