Bug 407458

Summary: Window minimize animation misplaced with PLASMA_USE_QT_SCALING=1
Product: [Plasma] plasmashell Reporter: Sebastian Krzyszkowiak <dos>
Component: generalAssignee: Nate Graham <nate>
Status: RESOLVED FIXED    
Severity: wishlist CC: elman, nate, plasma-bugs
Priority: NOR    
Version: 5.15.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.72
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 356446    

Description Sebastian Krzyszkowiak 2019-05-12 13:01:58 UTC
SUMMARY

When using PLASMA_USE_QT_SCALING=1 on X11 (as it's the only way to get correct paddings and UI sizing in Plasma under X11 on a hidpi screen) and minimizing window with a KWin effect, Plasma reports unscaled iconGeometry (in logical coordinates instead of real pixels that KWin expects, like 200x850 instead of 400x1700 on 2x screen), resulting in wrong animations.

STEPS TO REPRODUCE
1. Use Plasma on a hidpi screen with PLASMA_USE_QT_SCALING=1 enabled
2. Try to minimize a window by clicking on the taskbar icon (with some minimization animation enabled in KWin)

OBSERVED RESULT

The window gets minimized to some place in the middle of the screen.

EXPECTED RESULT

The window gets minimized to the clicked taskbar icon.

SOFTWARE/OS VERSIONS

KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.57
Qt Version: 5.12.3

ADDITIONAL INFORMATION

https://phabricator.kde.org/T8177#176789
Comment 1 David Edmundson 2019-05-12 15:18:08 UTC
This is  precisely why plasmashell doesn't use Qt scaling!

You mix two geometry spaces. X doesn't have a standardised logical pixel size. 
If you have two processes (kwin and plasma) speaking to each other in different geometry spaces you have tonnes of these bugs.

Don't set random envs.
Comment 2 Sebastian Krzyszkowiak 2019-05-12 15:32:04 UTC
I don't set random envs, I know what I'm getting into. Not using Qt scaling in Plasma leads to an aesthetic disaster with hidpi scaling. The alternative is a minor glitch reported here. Finding the cases where geometry spaces are being mixed up and fixing them seems to be a correct way to go, as I was advised in T8177.
Comment 3 David Edmundson 2019-06-23 15:18:06 UTC
*** Bug 394812 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2020-06-17 23:32:10 UTC
Working on this.
Comment 5 Bug Janitor Service 2020-06-18 14:11:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/96
Comment 6 Bug Janitor Service 2020-07-02 15:53:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwindowsystem/-/merge_requests/2
Comment 7 Nate Graham 2020-07-02 16:21:23 UTC
Git commit b7057a38e142f6ec673526026352cb061e9d2731 by Nate Graham.
Committed on 02/07/2020 at 16:21.
Pushed by ngraham into branch 'master'.

[xcb] Send correctly scaled icon geometry

Otherwise when using Qt scaling on X11, icon information has the wrong
size and location on screen, with the user-visible effect that window
Minimize animations minimize the window to the wrong location when
using Qt scaling on X11 with a high DPI screen. The effect is especially
hilarious with the Magic Lamp minimize effect and a bottom panel. This
change fixes all of that so that the minimize animations work properly
on X11 with Qt scaling and a high DPI screen.
FIXED-IN: 5.72

M  +6    -4    src/platforms/xcb/netwm.cpp

https://invent.kde.org/frameworks/kwindowsystem/commit/b7057a38e142f6ec673526026352cb061e9d2731