diff --git a/src/duckstation-nogui/sdl_host_interface.cpp b/src/duckstation-nogui/sdl_host_interface.cpp index aad357792..76cf9422a 100644 --- a/src/duckstation-nogui/sdl_host_interface.cpp +++ b/src/duckstation-nogui/sdl_host_interface.cpp @@ -97,6 +97,9 @@ bool SDLHostInterface::SetFullscreen(bool enabled) SDL_SetWindowFullscreen(m_window, enabled ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); m_fullscreen = enabled; + + const bool hide_cursor = (enabled && GetBoolSettingValue("Main", "HideCursorInFullscreen", true)); + SDL_ShowCursor(hide_cursor ? SDL_DISABLE : SDL_ENABLE); return true; } @@ -145,10 +148,7 @@ bool SDLHostInterface::CreatePlatformWindow(bool fullscreen) } if (fullscreen || m_fullscreen) - { - SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN_DESKTOP); - m_fullscreen = true; - } + SetFullscreen(true); ImGui_ImplSDL2_Init(m_window); diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index ed1f7bedd..e02b5887f 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -514,7 +514,8 @@ void CommonHostInterface::CreateImGuiContext() ImGui::GetIO().IniFilename = nullptr; #ifndef __ANDROID__ // Android has no keyboard, nor are we using ImGui for any actual user-interactable windows. - ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard | ImGuiConfigFlags_NavEnableGamepad; + ImGui::GetIO().ConfigFlags |= + ImGuiConfigFlags_NavEnableKeyboard | ImGuiConfigFlags_NavEnableGamepad | ImGuiConfigFlags_NoMouseCursorChange; #endif } diff --git a/src/frontend-common/fullscreen_ui.cpp b/src/frontend-common/fullscreen_ui.cpp index 1ce422842..09f9a045d 100644 --- a/src/frontend-common/fullscreen_ui.cpp +++ b/src/frontend-common/fullscreen_ui.cpp @@ -1297,6 +1297,9 @@ void DrawSettingsWindow() settings_changed |= ToggleButton("Start Fullscreen", "Automatically switches to fullscreen mode when the program is started.", &s_settings_copy.start_fullscreen); + settings_changed |= ToggleButtonForNonSetting( + "Hide Cursor In Fullscreen", "Hides the mouse pointer/cursor when the emulator is in fullscreen mode.", + "Main", "HideCursorInFullscreen", true); settings_changed |= ToggleButton("Load Devices From Save States", "When enabled, memory cards and controllers will be overwritten when save states are loaded.",