From 18240b3ed015d7e91e5c35f4a5a49714e3aed63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 12 Nov 2024 11:30:01 +0100 Subject: [PATCH] Don't full-screen-on-doubleclick if ImGui debugger is active --- Windows/MainWindow.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index ab00f6c495..9e0368df2b 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -641,20 +641,20 @@ namespace MainWindow SetCapture(hWnd); // Simulate doubleclick, doesn't work with RawInput enabled - static double lastMouseDown; + static double lastMouseDownTime; static float lastMouseDownX = -1.0f; static float lastMouseDownY = -1.0f; - double now = time_now_d(); - if ((now - lastMouseDown) < 0.001 * GetDoubleClickTime()) { - float dx = lastMouseDownX - x; - float dy = lastMouseDownY - y; - float distSq = dx * dx + dy * dy; - if (distSq < 3.0f*3.0f && !g_Config.bShowTouchControls && !g_Config.bMouseControl && GetUIState() == UISTATE_INGAME && g_Config.bFullscreenOnDoubleclick) { + const double now = time_now_d(); + if ((now - lastMouseDownTime) < 0.001 * GetDoubleClickTime()) { + const float dx = lastMouseDownX - x; + const float dy = lastMouseDownY - y; + const float distSq = dx * dx + dy * dy; + if (distSq < 3.0f*3.0f && !g_Config.bShowTouchControls && !g_Config.bShowImDebugger && !g_Config.bMouseControl && GetUIState() == UISTATE_INGAME && g_Config.bFullscreenOnDoubleclick) { SendToggleFullscreen(!g_Config.UseFullScreen()); } - lastMouseDown = 0.0; + lastMouseDownTime = 0.0; } else { - lastMouseDown = now; + lastMouseDownTime = now; } lastMouseDownX = x; lastMouseDownY = y;