1
0
Fork 0

source/Platform/Win32/Win32Mouse.cpp: in update() call GetActiveWindow() instead of GetCapture()

We want the currently focused window whether it is captured or not.
This commit is contained in:
Henrik Hautakoski 2023-08-23 20:05:54 +02:00
parent ea763a9f38
commit f6c44a223b

View file

@ -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);
}