5502ce9a9c
`Placements::placeSmart` searches for an optimal position for windows, attempting to minimize overlap. The core of this algorithm tracks the client's height and width in `ch` and `cw`, which have been adjusted by -1. This simplifies logic determining the bottom and right points of a window when you are starting at the top and left points. However, this decision requires adjusting that number by +1 when doing the opposite: determining the top and left points when you start with the bottom and right points. placeSmart cycles through window locations, searching for acceptable nooks and crannies to fit a window in, nicely. It begins by checking for places to put the top left corner of the window which abut another constraint. If that fails, it then tries to place the bottom right abutting a constraining feature. After finding a suitable bottom (or right) location, the top (or left) location must be determined, requiring the -1 adjustment to be undone. This patch adds that +1 back in. # The bug it solves This error can be seen by opening a bunch of windows that are placed using the "Minimal Overlapping" rule. The open space on the screen will be tiled from left to right, and then top to bottom in the windows. Once no more windows can be placed like that, the next window will be placed at the extreme bottom-right corner. However, it will be one pixel too low and one pixel too far to the right---if you try to move the window, it will "snap" to the correct spot. This single pixel may seem minor or even irrelevant, but when you use the "Present Windows" desktop effect on a multiple-monitor setup, this one pixel will cause the window to show up on both monitors. |
||
---|---|---|
.. | ||
drm | ||
integration | ||
libinput | ||
libkwineffects | ||
CMakeLists.txt | ||
onscreennotificationtest.cpp | ||
onscreennotificationtest.h | ||
opengl_context_attribute_builder_test.cpp | ||
test_client_machine.cpp | ||
test_ftrace.cpp | ||
test_gestures.cpp | ||
test_utils.cpp | ||
test_virtual_desktops.cpp | ||
test_window_paint_data.cpp | ||
test_x11_timestamp_update.cpp | ||
test_xcb_size_hints.cpp | ||
test_xcb_window.cpp | ||
test_xcb_wrapper.cpp | ||
test_xkb.cpp | ||
testutils.h | ||
xcb_scaling_mock.cpp |