Bug 462876 - After porting to OffscreenEffect the Invert effect doesn't play well with Wobbly windows (window disappears when dragged), window decoration buttons are not updated on hover
Summary: After porting to OffscreenEffect the Invert effect doesn't play well with Wob...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: git master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-12-11 01:18 UTC by andriy.parhomenko
Modified: 2023-01-17 17:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andriy.parhomenko 2022-12-11 01:18:07 UTC
STEPS TO REPRODUCE
1. Enable Invert effect
2. Enable Wobbly windows effect 
3. Drag a window
4. Hover mouse on window decoration buttons 

OBSERVED RESULT
Window is dragged with wobbly effect; buttons are rerendered (highlighted)

EXPECTED RESULT
Window disappears; buttons not rerendered

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Neon Developer 
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.101
Qt Version: 5.15.7
Comment 1 andriy.parhomenko 2022-12-11 01:22:56 UTC
I'm sorry for accidentally swapping expected and observed results in the description, it should be vice versa
Comment 2 Nate Graham 2023-01-03 20:45:04 UTC
Can reproduce.
Comment 3 Bug Janitor Service 2023-01-10 10:52:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3412
Comment 4 Vlad Zahorodnii 2023-01-10 13:38:48 UTC
Git commit 0bd48513262465755c7cd531daf109c4ed35b222 by Vlad Zahorodnii.
Committed on 10/01/2023 at 12:05.
Pushed by vladz into branch 'master'.

effects: Fix projection matrix logic in OffscreenEffect

WindowPaintData contains two projection matrices -
screenProjectionMatrix and projectionMatrix. I'm not sure why we have
two.

screenProjectionMatrix is initialized by the scene. While
projectionMatrix is usually updated by the effects. The two are not in
sync.

On the other hand, OffscreenEffect takes into account only
screenProjectionMatrix. It means that if a window is transformed by two
offscreen effects, the final result is going to be broken because
an OffscreenEffect must use the projection matrix specified by another
OffscreenEffect, which it doesn't.

This change cleans up projection matrix properties in WindowPaintData,
so there's only one projection matrix property. With that, offscreen
effects can be properly nested.

M  +1    -1    src/effects/backgroundcontrast/contrast.cpp
M  +6    -13   src/libkwineffects/kwineffects.cpp
M  +1    -9    src/libkwineffects/kwineffects.h
M  +1    -1    src/libkwineffects/kwinoffscreeneffect.cpp
M  +1    -16   src/scene/itemrenderer_opengl.cpp
M  +0    -1    src/scene/itemrenderer_opengl.h

https://invent.kde.org/plasma/kwin/commit/0bd48513262465755c7cd531daf109c4ed35b222
Comment 5 andriy.parhomenko 2023-01-17 16:53:40 UTC
I've tried the recent build of KDE Neon Developer.
The issue with Wobbly windows is indeed fixed. But the issue with rendering window decoration buttons (maximize, minimize, close) on mouse hover still persists: when the Invert effect is enabled the buttons are not rerendered instantly, but have glitches, circles may be rendered on multiple buttons simultaneously, partially rendered or not rendered at all.
Comment 6 andriy.parhomenko 2023-01-17 16:54:20 UTC
Should I open a separate bugreport?
Comment 7 Nate Graham 2023-01-17 16:56:26 UTC
Yes please.