Bug 445140

Summary: "No titlebar and frame" Window rule makes applications open in a very tiny window.
Product: [Plasma] kwin Reporter: tomasralph2000
Component: rulesAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: isma.af, nate
Priority: NOR Keywords: wayland
Version: 5.23.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.23.5

Description tomasralph2000 2021-11-07 22:30:25 UTC
SUMMARY
If you add the "No titlebar and frame" window rule to any application, it will open in the tiniest possible window.

STEPS TO REPRODUCE
1. Add a window rule
2. Match the window class you desire
3. Add "No titlebar and frame" window rule and set it to "yes"
4. Apply
5. Open the program the rule is applying to.

OBSERVED RESULT
The window does indeed have no borders, but it opens in a very tiny window

EXPECTED RESULT
The window shouldn't have borders and it should open in the stored window size it previously had

SOFTWARE/OS VERSIONS
Linux: 5.14.16-arch1-1
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Here are some screenshots:

Expected result: https://i.imgur.com/DpUy8jz.jpg
Actual result: https://i.imgur.com/MckDDRy.jpg
Comment 1 tomasralph2000 2021-11-07 22:32:18 UTC
I forgot to note that this is a Wayland specific issue. The rule works perfectly fine on X11.
Comment 2 Ismael Asensio 2021-11-08 22:47:39 UTC
I can reproduce.

This happens only on wayland, and for new opened windows. 
If the rule is applied to an already open window, it will behave as expected.

I think it has to do with `setNoBorder(true)` in xdgshellclient more than with rules themselves (but rules are the easier way to trigger this behavior).
Comment 3 Bug Janitor Service 2021-12-12 14:38:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1787
Comment 4 Ismael Asensio 2021-12-13 10:31:36 UTC
Git commit 77b678c522cce0e8e7b39087f74e2ac591cd28d0 by Ismael Asensio.
Committed on 13/12/2021 at 00:23.
Pushed by iasensio into branch 'Plasma/5.23'.

XDGShellClient: Protect from invalid frameGeometry on updateDecoration

When updating window decoration do not try to restore the previous frameGeometry
if it was invalid.

This fixes the case when applying a `noBorder=true` rule on a newly created
client would set it to a minimal window size

Targeted at 5.23 only, since this codepath is being reworked for 5.24
FIXED-IN: 5.23.5

M  +1    -1    src/xdgshellclient.cpp

https://invent.kde.org/plasma/kwin/commit/77b678c522cce0e8e7b39087f74e2ac591cd28d0