Skip to content

Commit

Permalink
Don't full-screen-on-doubleclick if ImGui debugger is active
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Nov 12, 2024
1 parent df104e7 commit e1f89ad
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Windows/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e1f89ad

Please sign in to comment.