Diffusion KWin 14c8440f11f9

Restrict move resize area only on the screen the strut window is on

Authored by graesslin on Jul 8 2017, 6:41 AM.

Description

Restrict move resize area only on the screen the strut window is on

Summary:
By allowing panels between screens in 5.8 to have a strut we created a
"regression" in KWin. KWin always was wrong, just we didn't notice as
neither Plasma nor previously Kicker set a strut on panels between shared
screen edges.

The strut is created from the edge of the overall screen setup. This
means a panel on the left edge of a screen on the right has the strut
starting from the left screen. KWin uses the strut to restrict the move
resize area: a window decoration is not allowed to go below a strut. Thus
it becomes impossible to move the window from the right to the left
screen.

This change tries to solve this problem by only restricting the move area
on the screen the window with the strut is on. E.g. if the window is on
the right screen, the left screen is not affected. Thus it's possible
again to move a window from one screen to the other as the added test
case shows.

Unfortunately there are still corner cases where this won't work
correctly. If the window is on both screens this won't work. It is also a
rather heavy change for KWin and thus it's targeted for master and not
for the 5.10 or the 5.8 branch. If we notice that the patch works well
and doesn't create further issues, it should be considered for
backporting.

BUG: 371199
CCBUG: 370510
FIXED-IN: 5.11

Test Plan: Added test case

Reviewers: KWin, Plasma

Subscribers: plasma-devel, kwin

Tags: KWin

Differential Revision: https://phabricator.kde.org/D6562