Bug 444119 - [wayland] Hiding and showing window border causes window to extend vertically
Summary: [wayland] Hiding and showing window border causes window to extend vertically
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.23.1
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-20 14:51 UTC by indecisiveautomator
Modified: 2021-11-03 16:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description indecisiveautomator 2021-10-20 14:51:54 UTC
SUMMARY
When hiding and unhiding window borders (e.g. with Alt+,) under a Wayland session this causes the window to extend by about the size of the window's titlebar each time, eventually causing it to take up the full height of the display.


STEPS TO REPRODUCE
1. Hide window borders
2. Show window borders
3. Repeat

OBSERVED RESULT
In a Wayland session, window extends in size each time window borders are shown/hidden until the full height of the display is taken up. It does not extend beyond this once the window borders are enabled again, it seems.

EXPECTED RESULT
Window geometry and position stay the same each time the window borders are shown/hidden, on par with X11. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.14.12-arch1-1 (64bit)
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Unable to reproduce under X11.
Comment 1 Vlad Zahorodnii 2021-10-20 16:07:31 UTC
> (e.g. with Alt+,)

what's the full name of this shortcut?
Comment 2 indecisiveautomator 2021-10-20 16:09:51 UTC
It's called "Hide Window Border" under KWin Shortcuts.
Comment 3 Bug Janitor Service 2021-10-29 11:33:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1583
Comment 4 Vlad Zahorodnii 2021-10-29 14:40:35 UTC
Git commit 09952e1dc76ad1b7c15980980699b39cb2e5dd86 by Vlad Zahorodnii.
Committed on 29/10/2021 at 14:40.
Pushed by vladz into branch 'master'.

wayland: Fix wayland windows growing after toggling decorations

After the decoration is destroyed, we need to resize XdgToplevelClient
to ensure that the scheduled configure event will have correct size.

As is, xdg-toplevel configure events are delayed. When it's actually the
time to send a configure event, XdgToplevelClient will compute the
requested client size from the moveResizeGeometry().

If the moveResizeGeometry() still includes window decorations, the
window will get bigger.

M  +3    -2    src/abstract_client.cpp
M  +1    -2    src/x11client.cpp

https://invent.kde.org/plasma/kwin/commit/09952e1dc76ad1b7c15980980699b39cb2e5dd86
Comment 5 Vlad Zahorodnii 2021-11-03 16:56:13 UTC
Git commit ceec4e50508fa92f55ad8581586831fa2d8fe605 by Vlad Zahorodnii.
Committed on 03/11/2021 at 16:55.
Pushed by vladz into branch 'Plasma/5.23'.

wayland: Fix wayland windows growing after toggling decorations

After the decoration is destroyed, we need to resize XdgToplevelClient
to ensure that the scheduled configure event will have correct size.

As is, xdg-toplevel configure events are delayed. When it's actually the
time to send a configure event, XdgToplevelClient will compute the
requested client size from the moveResizeGeometry().

If the moveResizeGeometry() still includes window decorations, the
window will get bigger.
(cherry picked from commit 09952e1dc76ad1b7c15980980699b39cb2e5dd86)

M  +3    -2    src/abstract_client.cpp
M  +1    -2    src/x11client.cpp

https://invent.kde.org/plasma/kwin/commit/ceec4e50508fa92f55ad8581586831fa2d8fe605