Bug 460398

Summary: When display scale changes, all position and size rules need to be changed manually
Product: [Applications] systemsettings Reporter: gudvinr+kde
Component: kcm_kwinrulesAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: isma.af, jlp, plasma-bugs
Priority: NOR    
Version: 6.0.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description gudvinr+kde 2022-10-13 23:01:42 UTC
SUMMARY

If you have rules that change position and/or size and then change scale, display starts being smaller/bigger virtually and thus old values do not work anymore.

I personally have quite a bit of those rules to position media players, etc on different screens so it means I need to change each one individually. And if you change scale in the future it should be done again.

Also after changing display style of screen coordinates from newX x newY to oldX x oldY@scale it is now impossible to know what your real resolution even is, so you need to open calculator and do that yourself which is rather inconvenient.

STEPS TO REPRODUCE
1. Create window rule that places window at some positions other than 0x0 in virtual screen space
2. Open window that you created rule for and confirm its position in physical space on monitor
3. Close window
4. Change display scale in display configuration
5. Open same window again

OBSERVED RESULT
Display will be placed using same pixel coordinates which are not in the same physical position on screen.

EXPECTED RESULT
Position from rules uses scale factors to calculate position and size for windows.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 6.0.1-zen1-1-zen (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION

There will be complications caused by use of multiple displays.
For example, if you have 2 displays, one of which is 1000x500 and another one is 500x1000 and you apply scale 150% for the first and 125% for second one, then window placed at 1250x0 in pixel coordinates  should be located at 866x0 in virtual screen space (1000*100/150 + 250*100/125) if my calculations are correct.