Bug 458013 - The maximize window button disappears when setting Size with "Apply Now" policy
Summary: The maximize window button disappears when setting Size with "Apply Now" policy
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (other bugs)
Version First Reported In: 5.25.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-17 22:22 UTC by popov895
Modified: 2022-09-14 11:44 UTC (History)
2 users (show)

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


Attachments
Maximize button disappears (66.33 KB, image/png)
2022-08-17 22:22 UTC, popov895
Details
Property and policy (86.56 KB, image/png)
2022-08-18 11:57 UTC, popov895
Details

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2022-08-17 22:22:09 UTC
Created attachment 151390 [details]
Maximize button disappears

SUMMARY

After changing Special Window Settings and applying the changes immediately,, the maximize window button disappears.

STEPS TO REPRODUCE

1. Open window menu (right click on the titlebar)
2. Go to "More Actions" > "Configure Special Window Settings..."
3. Select some property to change (e.g. "Size")
4. Choose "Apply Now" in the dropdown list to the right of the selected property
5. Press Ok button

OBSERVED RESULT

The maximize window button disappears.

EXPECTED RESULT

The maximize window button disappears remains in place.

SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 36
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Graphics Platform: X11
Comment 1 Ismael Asensio 2022-08-18 10:51:29 UTC
Which specific property and policy are you setting when the maximize button disappear?
Does it also happen for different ones?

If for instance, you were setting the property "Size" with "Force" property, it is expected that the maximized button disappears, as the window size is not able to change now and there is no possibility to maximize it.
Comment 2 popov895 2022-08-18 11:57:34 UTC
Created attachment 151399 [details]
Property and policy

Yes, the description isn't quite accurate. Can only be reproduced if changing the "Size" property and choosing the "Apply Now" policy.
Comment 3 Ismael Asensio 2022-08-19 20:07:51 UTC
Thanks! I can reproduce it.

Indeed with "Apply Now" one can still maximize the window, so the button should be kept. 

In fact, if you maximize and minimize it by other means (ex. via Window Menu or keyboard shortcut) the maximize button appears back on the window title bar. I'm suspecting it gets disabled in a temporary state when applying the rule, and then does not get updated later. I will take a look.
Comment 4 Vlad Zahorodnii 2022-09-14 10:14:33 UTC
Can't reproduce
Comment 5 Ismael Asensio 2022-09-14 11:36:41 UTC
(In reply to Vlad Zahorodnii from comment #4)
> Can't reproduce

I've just checked and the behavior is different on Wayland than on X11: the maximize button visibility doesn't get updated "live" when rules change, just on window creation. 

This makes the bug as explained here to not get triggered on Wayland, but it could be considered a bug on its own: 
1. Set a rule with `Force`  `Size` on an open window -> maximize button still visible
2. Close and re-open the application -> maximize button is now invisible
3. Change the rule to `Not Affect` or even delete the property or the rule -> maximize button remains invisible
Comment 6 Vlad Zahorodnii 2022-09-14 11:44:32 UTC
(In reply to Ismael Asensio from comment #5)
> I've just checked and the behavior is different on Wayland than on X11: the
> maximize button visibility doesn't get updated "live" when rules change,
> just on window creation. 

Huh, I need to test it on X11 then. However, as far as I now, "Apply Now" rules should not be saved to the disk. So, when the window is remapped, the rules should not be applied because they have not been saved to the disk.

> This makes the bug as explained here to not get triggered on Wayland, but it
> could be considered a bug on its own: 
> 1. Set a rule with `Force`  `Size` on an open window -> maximize button
> still visible
> 2. Close and re-open the application -> maximize button is now invisible
> 3. Change the rule to `Not Affect` or even delete the property or the rule
> -> maximize button remains invisible

Right, we need to reevaluate isMaximizable(), which perhaps doesn't happen on wayland