From a2a3f5228addca0534d7bfb482831f057c92a745 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 23 Jun 2021 20:35:33 +0200 Subject: [PATCH] WindowServer: Scale Mouse movements This fixes a bug where if the current screen was using scaling, the mouse would be twice as fast as normal. --- Userland/Services/WindowServer/Screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Services/WindowServer/Screen.cpp b/Userland/Services/WindowServer/Screen.cpp index 326d79a44a..83bdd5a9ab 100644 --- a/Userland/Services/WindowServer/Screen.cpp +++ b/Userland/Services/WindowServer/Screen.cpp @@ -268,7 +268,7 @@ void ScreenInput::on_receive_mouse_data(const MousePacket& packet) m_cursor_location.translate_by(packet.x * m_acceleration_factor, packet.y * m_acceleration_factor); dbgln_if(WSSCREEN_DEBUG, "Screen: New Relative mouse point @ {}", m_cursor_location); } else { - m_cursor_location = { packet.x * current_screen.physical_width() / 0xffff, packet.y * current_screen.physical_height() / 0xffff }; + m_cursor_location = { packet.x * current_screen.width() / 0xffff, packet.y * current_screen.height() / 0xffff }; dbgln_if(WSSCREEN_DEBUG, "Screen: New Absolute mouse point @ {}", m_cursor_location); }