Commit 8b4ffd5c authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Relax conditions in strut edge heuristics

When the output layout changes, it's possible that the bottom panel
will float in the middle of the screen, e.g. left edge of the panel
touches the left screen edge while top and bottom panel edges touch no
screen edge.

In that case, XdgToplevelWindow::strutRect() will erroneously indicate
that the left strut rect is valid, while it's not.

Since the strut area is garbage, Window::checkWorkspacePosition() may
incorrectly move and resize windows during output layout change.

The proposed heuristic will fail with square panels, but those are rare
and the only way to detect the correct strut area would be to use the
layer shell protocol.
parent 82c09653
Pipeline #226897 passed with stage
in 13 minutes and 2 seconds
......@@ -791,22 +791,22 @@ StrutRect XdgToplevelWindow::strutRect(StrutArea area) const
switch (area) {
case StrutAreaTop:
if (top && ((!left && !right) || horizontal)) {
if (top && horizontal) {
return StrutRect(windowRect, StrutAreaTop);
return StrutRect();
case StrutAreaRight:
if (right && ((!top && !bottom) || !horizontal)) {
if (right && !horizontal) {
return StrutRect(windowRect, StrutAreaRight);
return StrutRect();
case StrutAreaBottom:
if (bottom && ((!left && !right) || horizontal)) {
if (bottom && horizontal) {
return StrutRect(windowRect, StrutAreaBottom);
return StrutRect();
case StrutAreaLeft:
if (left && ((!top && !bottom) || !horizontal)) {
if (left && !horizontal) {
return StrutRect(windowRect, StrutAreaLeft);
return StrutRect();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment