From 708f27ca0e9716026dc6efd0bce4567a12064825 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 25 Jun 2021 20:54:24 -0600 Subject: [PATCH] WindowServer: Use relative coordinates when flushing screen dirty rects The framebuffer device expects coordinates relative to itself. --- Userland/Services/WindowServer/Screen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Services/WindowServer/Screen.cpp b/Userland/Services/WindowServer/Screen.cpp index fc7497db0d..f8bb2ad8dc 100644 --- a/Userland/Services/WindowServer/Screen.cpp +++ b/Userland/Services/WindowServer/Screen.cpp @@ -319,8 +319,8 @@ void ScreenInput::on_receive_keyboard_data(::KeyEvent kernel_event) void Screen::flush_display(const Gfx::IntRect& flush_region) { FBRect rect { - .x = static_cast(flush_region.x()) * scale_factor(), - .y = static_cast(flush_region.y()) * scale_factor(), + .x = (static_cast(flush_region.x()) - m_virtual_rect.left()) * scale_factor(), + .y = (static_cast(flush_region.y()) - m_virtual_rect.top()) * scale_factor(), .width = static_cast(flush_region.width()) * scale_factor(), .height = static_cast(flush_region.height() * scale_factor()) };