Skip to content

Commit

Permalink
WindowServer: Fix calculating tile rect on secondary screens
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tomuta authored and linusg committed Apr 13, 2023
1 parent 6f9c5b7 commit fa7f9b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Userland/Services/WindowServer/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down

0 comments on commit fa7f9b0

Please sign in to comment.