Bug 445140 - "No titlebar and frame" Window rule makes applications open in a very tiny window.
Summary: "No titlebar and frame" Window rule makes applications open in a very tiny wi...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: 5.23.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2021-11-07 22:30 UTC by tomasralph2000
Modified: 2021-12-13 10:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.23.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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