Bug 448424 - Rules with "Apply Initially" are not applied for the Spotify client
Summary: Rules with "Apply Initially" are not applied for the Spotify client
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: rules (other bugs)
Version First Reported In: 5.23.5
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-14 00:56 UTC by Eric Edlund
Modified: 2022-02-04 11:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Edlund 2022-01-14 00:56:41 UTC
SUMMARY
Setting a window rule to "apply initially" doesn't do anything.

STEPS TO REPRODUCE
1. Add window rule Full screen, apply initially
2. Open that window/ application

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Neon 5.23 User Edition
(available in About System)
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Reproducible on both wayland and xorg
Comment 1 Ismael Asensio 2022-01-14 17:02:39 UTC
I cannot reproduce. It's working for me as expected using Kate as an example, even with position restore by the app.

With "Apply initially" sometimes the application overrides some window settings after the window is loaded.
With which application/s is this happening for you?
Comment 2 Eric Edlund 2022-01-14 17:46:44 UTC
On Kate (on latest neon it's KWrite if that matters) fullscreen apply initially is working, but maximize horizontally apply initially isn't.

I've been using spotify's official client and can't get apply initially to work for full screen or maximize.
snap install spotify
Comment 3 Eric Edlund 2022-01-14 17:47:34 UTC
When I answer a question, am I supposed to change the NEEDSINFO WAITINGFORINFO status?
Comment 4 Ismael Asensio 2022-01-14 19:02:51 UTC
> When I answer a question, am I supposed to change the NEEDSINFO WAITINGFORINFO status?
You can change it, so bugzilla knows the question's been addressed. Already did. Thanks for your prompt replay.

(In reply to Eric Edlund from comment #2)
> On Kate (on latest neon it's KWrite if that matters) fullscreen apply
> initially is working, but maximize horizontally apply initially isn't.
> 
This might be a different issue related with geometry being restored by the app, might worth trying to set "Ignore requested geometry" to "Force" "yes". Different rule properties are a bit independent in the way they are applied, so they are sometimes hard to debug without specifics :) and if there are bugs, they tend to have different causes.

> I've been using spotify's official client and can't get apply initially to
> work for full screen or maximize.

Ok, I can confirm that rule properties with "Apply initially" policy do not get applied to the spotify client. "Force" policy does work though.
This app is a bit "rogue" in relation to what it exposes to the window manager (and other linux standards, but they're trying a bit harder lately). 

I'll try to investigate. My guess is that the client is setting the window properties (mainly the window class) after the window has been created, so  when kwin has the information to match the rule, it is too late to "apply initially".
Comment 5 Vlad Zahorodnii 2022-02-04 11:32:53 UTC
> I'll try to investigate. My guess is that the client is setting the window properties (mainly the window class) after the window has been created, so  when kwin has the information to match the rule, it is too late to "apply initially".

That's correct, we actually made kwin non fully spec compliant to make sure that it reevaluates at least some window rules when spotify changes window class after getting mapped. There's nothing that we can do more. There are certain window rules that require applications to be well behaved with regards to specs.