Bug 428781 - Window Placement rule has no effect when "Remember app last position" option is enabled
Summary: Window Placement rule has no effect when "Remember app last position" option ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (other bugs)
Version First Reported In: 5.19.5
Platform: Kubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-07 12:22 UTC by Yuri
Modified: 2021-01-22 17:26 UTC (History)
3 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 Yuri 2020-11-07 12:22:50 UTC
SUMMARY
None of all options (Random, Centered, Cascade, etc...) is working. New instances put new windows exactly at the same place. 

STEPS TO REPRODUCE
1. Open any window (program)
2. Open a new instance or new window 

OBSERVED RESULT
New instances are placed at the same place. New app is put at last position.

EXPECTED RESULT
By default, "Minimal Overlapping". New instances are placed near or with minimal overlapping.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 20.10
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2
Kernel Version: 5.9.1-050901-generic
OS Type: 64-bit
Processors: 8 × AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx
Memory: 5,6 GiB of RAM
Graphics Processor: AMD RAVEN

ADDITIONAL INFORMATION
For test purpose, a new user was created and the result is the same.
Comment 1 Ismael Asensio 2020-11-07 13:21:43 UTC
This is happening when the new "Remember app last position" option is enabled.

I don't know if it's possible to make both features co-exist on X11, since they're managed in a different place (kwin and the app itself)
Comment 2 Yuri 2020-11-09 11:29:30 UTC
Is the option "Remember app last position" on by default? Cause even on live usb it is that way.
Where is it configurabled? (all apps as the same result)
On Kubuntu 20.04 and previous releases options on Window Placement work as expected.
Comment 3 Nate Graham 2020-12-07 17:41:37 UTC
Yes it is on by default. Unfortunately Kubuntu 20.10 does not include the GUI to turn it off. You can turn it off yourself by adding AllowKDEAppsToRememberWindowPositions=false inside the [general] section of your ~/.config/kdeglobals file.

Yeah, these features can't co-exist. Perhaps if the relevant window rule is set, KWin could automatically ignore the app's own positioning? Can it do that?
Comment 4 Ismael Asensio 2020-12-07 23:00:16 UTC
There is currently a mechanism within Window Rules to avoid the application from setting its on position and size, which solves this use case.

You need to add the property `Ignore Requested Geometry` and set it to `Force` `Yes`.

I'm thinking of adding a hint to suggest users about setting this property when the conditions are met.
Comment 5 Bug Janitor Service 2021-01-04 18:40:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/574
Comment 6 Ismael Asensio 2021-01-22 17:26:20 UTC
Git commit 231d96c5c6b1127c46702237d47a41a66f60f131 by Ismael Asensio.
Committed on 22/01/2021 at 17:18.
Pushed by iasensio into branch 'master'.

kcm/kwinrules: Add hint about ignore geometry

Some applications set their own geometry after start,
which overrides the initial rule settings for placement:
position, size and initial placement.

This happens now more often, after introducing the
"Remember app last position" feature for KXMLgui apps.

There is a mechanism to avoid that, by Forcing the rule property
"Ignore geometry", but it is unknown to many users.

This MR adds a hint when some rule properties might not be
respected by the application, so users can set this property
and hopefully avoid bug reports.

M  +12   -5    kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml
M  +58   -26   kcmkwin/kwinrules/rulesmodel.cpp
M  +7    -4    kcmkwin/kwinrules/rulesmodel.h

https://invent.kde.org/plasma/kwin/commit/231d96c5c6b1127c46702237d47a41a66f60f131