From 9975118aa16e5ef1a2356590e7b2e70338ffcf02 Mon Sep 17 00:00:00 2001 From: saa-games <271819929+saa-games@users.noreply.github.com> Date: Sat, 28 Mar 2026 18:26:37 +0000 Subject: [PATCH] ignore mouse input if not foreground window --- d2gl/src/win32.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/d2gl/src/win32.cpp b/d2gl/src/win32.cpp index 853e686..2311381 100644 --- a/d2gl/src/win32.cpp +++ b/d2gl/src/win32.cpp @@ -302,6 +302,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (!App.cursor.unlock && !App.cursor.locked) return 0; + if (GetForegroundWindow() != hWnd) + return 0; + int x = GET_X_LPARAM(lParam); int y = GET_Y_LPARAM(lParam);