Bug 422117

Summary: Previews in WindowHeap-based effects are rendered rough even when Scale Method is set to Accurate
Product: [Plasma] kwin Reporter: phd <phd>
Component: effects-window-managementAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: adam.m.fontenot+kde, mihai.bazon, mrgrim, nate, phd
Priority: NOR    
Version: 5.25.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: desktop-grid-maximized-windows-bug.png
systemsettings-compositor.png
Parallel_lines_in_Poincare's_model_of_hyperbolic_geometry.svg.png
KWin-supportInformation.txt
DesktopGrid-rough-windows-scaling-20210711-normal-vs-maximized.png
20220910-DesktopGrid-all-windows-rough-including-PlasmaDesktop-with-clock-widget.png
20220911_laptop-plasma-5-24-desktop-grid-ok.png
20220911_laptop-plasma-5-25-desktop-grid-rough.png

Description phd 2020-05-26 22:09:41 UTC
Created attachment 128813 [details]
desktop-grid-maximized-windows-bug.png

SUMMARY

In Desktop Grid effect maximized windows (and only maximized!) are rendered very rough even when Compositor's Scale Method is set to Accurate.
If you resize the window a little bit down, you get beautiful smooth and readable scaling again.

See "desktop-grid-maximized-windows-bug.png" screenshot:
Desktop 1x1: maximized Gwenview (rough!)
Desktop 1x2: maximized KWrite with some source code (rough!)
Desktop 2x1: normal window Gwenview (OK)
Desktop 2x2: normal window KWrite with the same source code (OK)

File displayed in Gwenview (attached):
https://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/Parallel_lines_in_Poincare%27s_model_of_hyperbolic_geometry.svg/1280px-Parallel_lines_in_Poincare%27s_model_of_hyperbolic_geometry.svg.png


STEPS TO REPRODUCE

1. In System Settings set the Compositor's Scale Method to Accurate.
2. Enable Desktop Grid effect.
3. Open some maximized windows (one window per virtual desktop).
4. Activate Desktop Grid effect.


OBSERVED RESULT

Desktop 1x1: maximized Gwenview (rough!)
Desktop 1x2: maximized KWrite with some source code (rough!)


EXPECTED RESULT

Maximized windows in Desktop Grid should be rendered smooth and readable.


SOFTWARE/OS VERSIONS

Linux: Ubuntu 20.04
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Comment 1 phd 2020-05-26 22:10:04 UTC
Created attachment 128814 [details]
systemsettings-compositor.png
Comment 2 phd 2020-05-26 22:10:21 UTC
Created attachment 128815 [details]
Parallel_lines_in_Poincare's_model_of_hyperbolic_geometry.svg.png
Comment 3 phd 2020-05-26 22:11:34 UTC
Also: maximized GTK windows (eg. Firefox) experience the same problem.
Comment 4 Vlad Zahorodnii 2020-05-27 10:59:38 UTC
Hmm, I can't reproduce it on my 4K monitor. Can I have the output of `qdbus org.kde.KWin /KWin supportInformation`?
Comment 5 phd 2020-05-27 13:24:05 UTC
Created attachment 128840 [details]
KWin-supportInformation.txt

`qdbus org.kde.KWin /KWin supportInformation` attached
Comment 6 Vlad Zahorodnii 2020-05-28 13:23:33 UTC
I'm not 100% sure but it seems like the aliasing is introduced by the Lanczos filter.
Comment 7 Vlad Zahorodnii 2020-05-28 13:24:43 UTC
Just for context: The Desktop Grid effect uses the Lanczos filter to smooth scaled windows.
Comment 8 phd 2020-11-24 23:04:02 UTC
Still happening in kwin 5.19.5, bumping Version.
Comment 9 phd 2021-07-11 23:10:11 UTC
Created attachment 139999 [details]
DesktopGrid-rough-windows-scaling-20210711-normal-vs-maximized.png

I can still reproduce this bug with latest KDE on every computer I have:
- PC with nVidia GeForce 970 - using proprietary nVidia driver (465.31)
- old Acer laptop (Intel GPU + nVidia GeForce GT 520M) - using Intel i915 driver
- new Lenovo laptop (Intel GPU + nVidia GeForce GTX 1650) - using Intel i915 driver (screenshot attached)
Comment 10 phd 2022-01-09 16:34:18 UTC
This issue still occurs in KWin 5.23.5 (with the new Desktop Grid effect).

I pinpointed the exact size of the window for which the issue happens.
Maximum size of the window that is displayed properly is 1880 x 1015.
Anything above this in either width or height causes the window to be displayed rough.

My display size is 1920 x 1080 (FullHD).
My panel is on the bottom of the screen, its height is 22px.
Comment 11 Marco Martin 2022-05-06 10:46:37 UTC
Git commit 7a4cabf3287e82e7d1d6ba84b8b059ab470f9f42 by Marco Martin.
Committed on 06/05/2022 at 10:44.
Pushed by mart into branch 'master'.

QML version of the Desktop Grid effect

Replace completely the old desktop grid effect with a QML version.
Aims to feature parity and be a change as transparent as possible for the user.
Related: bug 433071, bug 452625, bug 443971, bug 437121, bug 452925, bug 437928, bug 452439, bug 288530, bug 450254, bug 450106, bug 447832, bug 449960, bug 416576, bug 441862, bug 444859, bug 445999, bug 404627, bug 435483, bug 420744, bug 435482, bug 427055, bug 333445, bug 429120, bug 427391, bug 409295, bug 294322, bug 356955
FIXED-IN: 5.25

M  +5    -0    src/effects.cpp
M  +10   -5    src/effects/desktopgrid/CMakeLists.txt
D  +0    -1571 src/effects/desktopgrid/desktopgrid.cpp
D  +0    -186  src/effects/desktopgrid/desktopgrid.h
D  +0    -32   src/effects/desktopgrid/desktopgrid.kcfg
M  +6    -14   src/effects/desktopgrid/desktopgrid_config.cpp
M  +2    -2    src/effects/desktopgrid/desktopgrid_config.h
M  +68   -144  src/effects/desktopgrid/desktopgrid_config.ui
A  +32   -0    src/effects/desktopgrid/desktopgridconfig.kcfg
M  +5    -1    src/effects/desktopgrid/desktopgridconfig.kcfgc
A  +342  -0    src/effects/desktopgrid/desktopgrideffect.cpp     [License: GPL(v2.0+)]
A  +108  -0    src/effects/desktopgrid/desktopgrideffect.h     [License: GPL(v2.0+)]
M  +5    -4    src/effects/desktopgrid/main.cpp
D  +0    -26   src/effects/desktopgrid/main.qml
M  +1    -0    src/effects/desktopgrid/metadata.json
A  +255  -0    src/effects/desktopgrid/qml/DesktopView.qml     [License: GPL(v2.0+)]
A  +193  -0    src/effects/desktopgrid/qml/main.qml     [License: GPL(v2.0+)]
M  +22   -5    src/effects/private/qml/WindowHeap.qml
M  +21   -3    src/libkwineffects/kwineffects.h
M  +4    -1    src/libkwineffects/kwinquickeffect.cpp

https://invent.kde.org/plasma/kwin/commit/7a4cabf3287e82e7d1d6ba84b8b059ab470f9f42
Comment 12 phd 2022-09-10 10:08:18 UTC
I have just updated Plasma from 5.24 to 5.25.5 (from backports-extra repository) on my PC.

And now... every window, even small ones, in Grid View is broken (rendered rough).
Including Plasma Desktop underneath.

I will also test this later on my laptop with a clean installation of Kubuntu.
Comment 13 phd 2022-09-10 20:43:09 UTC
Created attachment 151971 [details]
20220910-DesktopGrid-all-windows-rough-including-PlasmaDesktop-with-clock-widget.png
Comment 14 phd 2022-09-11 22:31:12 UTC
Created attachment 151995 [details]
20220911_laptop-plasma-5-24-desktop-grid-ok.png
Comment 15 phd 2022-09-11 22:31:40 UTC
Created attachment 151996 [details]
20220911_laptop-plasma-5-25-desktop-grid-rough.png
Comment 16 phd 2022-09-11 22:34:50 UTC
I have just updated Plasma from 5.24 to 5.25.5 (from backports-extra repository) on my LAPTOP.
The effect is the same as on the PC, and this is a clean installation of Kubuntu in my laptop.

Every window, even small ones, in Desktop Grid view is now broken (rendered rough).
Including Plasma Desktop underneath (the clock widget can be seen scaled badly).

See attached screenshots:
- 20220911_laptop-plasma-5-24-desktop-grid-ok.png
- 20220911_laptop-plasma-5-25-desktop-grid-rough.png

Reopening this bug.
Comment 17 Mihai Bazon 2022-10-19 14:10:45 UTC
This has been reported separately for 5.25+: https://bugs.kde.org/show_bug.cgi?id=457817
Comment 18 Nate Graham 2023-09-12 17:06:46 UTC
*** Bug 457817 has been marked as a duplicate of this bug. ***