Bug 398899

Summary: Blur in menus works only on first call
Product: [Plasma] kwin Reporter: tromzy
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Severity: normal CC: bugseforuns, look.for.borgy, matejm98mthw, nate, notuxius
Priority: NOR Keywords: wayland
Version: 5.13.90   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.16.0
Sentry Crash Report:

Description tromzy 2018-09-21 08:03:47 UTC
On Plasma 5.14 beta, with Breeze Dark window style, the blur effect in application menubar (Konsole, Dolphin, etc.) only applies once :

- open Dolphin (or kate, konsole, etc.)
- open the menubar : the blur effect is applied
- close the menu bar
- reopen it : the blur effect does not apply
- close Dolphin, then reopen it
- open the menubar : blur effect is applied again, but if you close it and reopen it, it is lost again.
Comment 1 Alexander Mentyu 2018-09-21 11:01:01 UTC
Translucency and blur effects are enabled
Intel+NVIDIA video cards
OpenGL 2 compositor
Menus are transparent without blurring after each RMB press only in XWayland windows for me - in Chromium for example

Operating System: KDE neon Developer Edition
KDE Plasma Version: 5.14.80
Qt Version: 5.11.1
KDE Frameworks Version: 5.51.0
Kernel Version: 4.15.0-34-generic
Comment 2 Patrick Silva 2018-09-21 21:10:39 UTC
I can confirm on two computers running different distros (Arch with plasma 5.14 beta and neon dev unstable).
Comment 3 Vlad Zahorodnii 2018-09-22 10:06:52 UTC
Just for tracking:

* The first and the second popup have the same WId;
* Surface::fromQtWinId (at https://phabricator.kde.org/source/kwayland-integration/browse/master/src/windowsystem/windoweffects.cpp$136) returns nullptr for the second popup. Thus, the blur effect doesn't get blur region.
Comment 4 Matej Mrenica 2018-10-03 17:26:34 UTC
I can confirm this, but only on Wayland.
Comment 5 Patrick Silva 2019-03-05 23:12:54 UTC
bug persists on Wayland

Operating System: Arch Linux 
KDE Plasma Version: 5.15.2
KDE Frameworks Version: 5.55.0
Qt Version: 5.12.1
Comment 6 Patrick Silva 2019-04-26 11:12:16 UTC
*** Bug 406905 has been marked as a duplicate of this bug. ***
Comment 7 David Edmundson 2019-05-02 08:44:47 UTC
Git commit 0a0c3f23fce265f36e5b8fb2b4b8bd311c7c1beb by David Edmundson.
Committed on 02/05/2019 at 08:44.
Pushed by davidedmundson into branch 'master'.

Track surface creation/destruction inside wayland window effects

The wayland surface is destroyed and recreated after every hide/show. As
it's a new surface, it needs a new blur attached and applied.

The best hook is the expose event on the window.

The current event filtering in Breeze operates on the QWidget which
doesn't match the window. Fixing there still introduces a second layer
of event filters on another object once the window is known.

Whilst it could be done in breeze, clients should ideally just call
KWindowEffects once per window and forget about it regardless of
the underlying state. It also fixes all other wayland users of the call
at once.

This fixes blur on context menus opened a second time.

Test Plan:
Turned on the show transparency effect in breeze
Opened a context menu multiple times
Observed that it was transparent and blurred

Reviewers: #kwin

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D20951

M  +109  -4    src/windowsystem/windoweffects.cpp
M  +22   -2    src/windowsystem/windoweffects.h