From f6c44a223bff84c00fc153d4feb3cb4fee15fa3a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 23 Aug 2023 20:05:54 +0200 Subject: [PATCH] source/Platform/Win32/Win32Mouse.cpp: in update() call GetActiveWindow() instead of GetCapture() We want the currently focused window whether it is captured or not. --- source/Platform/Win32/Win32Mouse.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Platform/Win32/Win32Mouse.cpp b/source/Platform/Win32/Win32Mouse.cpp index 61a49da..d1ef2e4 100644 --- a/source/Platform/Win32/Win32Mouse.cpp +++ b/source/Platform/Win32/Win32Mouse.cpp @@ -64,9 +64,10 @@ void Win32Mouse::update(InputModule *input) m_abs_position = Vector2f(p.x, p.y); // Update relative position - handle = ::GetCapture(); + // Get the active window. + handle = ::GetActiveWindow(); if (handle) { - // Translate position to focued window. + // Translate position to the active window. ScreenToClient(handle, &p); m_position = Vector2f(p.x, p.y); }