kwin/autotests/integration
Antonio Russo 5502ce9a9c placeSmart: Properly track width and height
`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.
2023-08-07 07:14:18 +00:00
..
data
effects
fakes
helper
protocols
scripting
activation_test.cpp
activities_test.cpp
CMakeLists.txt
dbus_interface_test.cpp
debug_console_test.cpp
decoration_input_test.cpp
desktop_window_x11_test.cpp
dont_crash_aurorae_destroy_deco.cpp
dont_crash_cancel_animation.cpp
dont_crash_empty_deco.cpp
dont_crash_glxgears.cpp
dont_crash_reinitialize_compositor.cpp
dont_crash_useractions_menu.cpp
fractional_scaling_test.cpp
generic_scene_opengl_test.cpp
generic_scene_opengl_test.h
globalshortcuts_test.cpp
idle_inhibition_test.cpp
input_stacking_order.cpp
inputmethod_test.cpp
internal_window.cpp
keyboard_layout_test.cpp
keymap_creation_failure_test.cpp
kwin_wayland_test.cpp
kwin_wayland_test.h
kwinbindings_test.cpp
layershellv1window_test.cpp
lockscreen.cpp
maximize_test.cpp
modifier_only_shortcut_test.cpp
move_resize_window_test.cpp
no_global_shortcuts_test.cpp
outputchanges_test.cpp
placement_test.cpp
plasma_surface_test.cpp
plasmawindow_test.cpp
platformcursor.cpp
pointer_constraints_test.cpp
pointer_input.cpp
quick_tiling_test.cpp
scene_opengl_es_test.cpp
scene_opengl_test.cpp
screen_changes_test.cpp
screencasting_test.cpp
screenedges_test.cpp
screens_test.cpp
shade_test.cpp
showing_desktop_test.cpp
stacking_order_test.cpp
struts_test.cpp
tabbox_test.cpp
test_helpers.cpp
test_virtualkeyboard_dbus.cpp
tiles_test.cpp
touch_input_test.cpp
transient_placement.cpp
virtual_desktop_test.cpp
window_rules_test.cpp
window_selection_test.cpp
x11_window_test.cpp
xdgshellwindow_rules_test.cpp
xdgshellwindow_test.cpp
xwayland_input_test.cpp
xwayland_selections_test.cpp
xwaylandserver_crash_test.cpp
xwaylandserver_restart_test.cpp