From ca2d4ad43bc3b8c91c35a4a66cd27d2ce1a65ce3 Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Mon, 1 Dec 2025 15:29:42 +0900 Subject: [PATCH] [UI] Disable all mouse interactions in game window through cvar --- src/xenia/app/emulator_window.cc | 12 ++++++++---- src/xenia/ui/config_helpers.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index 0082530af..b51b87730 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -217,9 +217,9 @@ DEFINE_bool(use_gamemode, false, "GameMode must be installed on your system for this to work.", "Linux"); #endif -DEFINE_bool(disable_doubleclick_fullscreen, false, - "Allows the user to disable the behavior where a fast double-click " - "causes Xenia to enter fullscreen mode.", +DEFINE_bool(disable_game_window_mouse, false, + "Disables mouse interactions in the game window, including " + "double-click to fullscreen and right-click context menu.", "General"); namespace xe { @@ -1088,6 +1088,10 @@ void EmulatorWindow::OnKeyDown(ui::KeyEvent& e) { void EmulatorWindow::OnMouseDown(const ui::MouseEvent& e) { if (e.button() == ui::MouseEvent::Button::kRight) { + if (cvars::disable_game_window_mouse) { + return; + } + // If menu is already open, close it instead of opening a new one if (context_menu_widget_qt_) { context_menu_widget_qt_->close(); @@ -1229,7 +1233,7 @@ void EmulatorWindow::SaveImage(const std::filesystem::path& filepath, } void EmulatorWindow::OnMouseDoubleClick(const ui::MouseEvent& e) { - if (cvars::disable_doubleclick_fullscreen) { + if (cvars::disable_game_window_mouse) { return; } // Don't toggle fullscreen if any ImGui dialogs are open diff --git a/src/xenia/ui/config_helpers.h b/src/xenia/ui/config_helpers.h index 0436800e8..fa0f395b2 100644 --- a/src/xenia/ui/config_helpers.h +++ b/src/xenia/ui/config_helpers.h @@ -36,6 +36,8 @@ inline const std::vector& GetCvarAliases() { {"render_target_path_d3d12", "rov", "render_target_path", "accuracy"}, {"render_target_path_vulkan", "fbo", "render_target_path", "performance"}, {"render_target_path_vulkan", "fsi", "render_target_path", "accuracy"}, + {"disable_doubleclick_fullscreen", "true", "disable_game_window_mouse", + "true"}, #if XE_PLATFORM_WIN32 {"gpu", "any", "gpu", "d3d12"}, {"apu", "any", "apu", "xaudio2"},