1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

WindowServer: Fix calculating tile rect on secondary screens

The screen rectangle's origin is only {0, 0} on the main screen, so
we need to move the tile rectangle relative to its location.
This commit is contained in:
Tom 2023-04-03 21:28:12 -06:00 committed by Linus Groh
parent 6f9c5b71fd
commit fa7f9b0f35

View file

@ -1987,7 +1987,7 @@ Gfx::IntRect WindowManager::tiled_window_rect(Window const& window, WindowTileTy
|| tile_type == WindowTileType::TopRight
|| tile_type == WindowTileType::BottomRight) {
rect.set_width(rect.width() / 2);
rect.set_x(rect.width());
rect.set_x(rect.x() + rect.width());
}
if (tile_type == WindowTileType::Top
@ -2001,7 +2001,7 @@ Gfx::IntRect WindowManager::tiled_window_rect(Window const& window, WindowTileTy
|| tile_type == WindowTileType::BottomRight) {
auto half_screen_remainder = rect.height() % 2;
rect.set_height(rect.height() / 2 + half_screen_remainder);
rect.set_y(rect.height() - half_screen_remainder);
rect.set_y(rect.y() + rect.height() - half_screen_remainder);
}
Gfx::IntRect window_rect = window.rect();