Bug 372001 - KWin's context menus don't have shadows on wayland
Summary: KWin's context menus don't have shadows on wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-02 20:54 UTC by Kai Uwe Broulik
Modified: 2016-11-07 10:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.8.4
Sentry Crash Report:
mgraesslin: Wayland+
mgraesslin: X11-
mgraesslin: ReviewRequest+


Attachments
Screenshot with menus (47.93 KB, image/png)
2016-11-03 09:11 UTC, Martin Flöser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2016-11-02 20:54:59 UTC
KWin's context menus like the user actions menu don't have shadows on Wayland.

1.) Right-click title bar of a window on kwin_wayland
Comment 1 Martin Flöser 2016-11-03 06:20:51 UTC
Uh that might get tricky
Comment 2 Martin Flöser 2016-11-03 08:21:58 UTC
I just investigated a bit. The main problem here is that the KStyle tries to init Wayland prior to KWin having an internal Wayland connection.
Comment 3 Martin Flöser 2016-11-03 09:11:47 UTC
Created attachment 101993 [details]
Screenshot with menus

Made some progress and found a solution which gets the menus to show. But it seems to create severe regressions on tear down.
Comment 4 Martin Flöser 2016-11-03 09:16:43 UTC
And as I feared. The ShadowHelper destroys the Wayland objects after KWin destroyed the internal Wayland connection. With latest libwayland that will cause a crash on tear-down.
Comment 6 Martin Flöser 2016-11-07 10:28:52 UTC
Git commit ee7da425cefcd5cbe480335a144eee6218207dd9 by Martin Gräßlin.
Committed on 07/11/2016 at 10:28.
Pushed by graesslin into branch 'Plasma/5.8'.

Unpolish QStyle on QApp prior to destroying internal Wayland connection

Summary:
The QStyle might interact with our internal Wayland connection. If the
cleanup happens after destroying our internal Wayland connection KWin
will crash at tear-down.

With this change the QStyle can perform cleanup already prior to the
deconstruction of the Wayland connection.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

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

M  +4    -0    autotests/integration/kwin_wayland_test.cpp
M  +4    -0    main_wayland.cpp

http://commits.kde.org/kwin/ee7da425cefcd5cbe480335a144eee6218207dd9
Comment 7 Martin Flöser 2016-11-07 10:47:40 UTC
Git commit 088c7672981ba6d4b83946a280683764ce300d60 by Martin Gräßlin.
Committed on 03/11/2016 at 09:55.
Pushed by graesslin into branch 'Plasma/5.8'.

[kstyle] Delay init of Wayland setup till next event cycle

Summary:
This is a change mostly for KWin (the Wayland compositor). The internal
Wayland connection is created after the QStyle is created in the case of
KWin. But both are created before the event dispatcher is run for the
first time. So delaying by one cycle makes it work for KWin and also all
other Wayland applications.
FIXED-IN: 5.8.4

Reviewers: #plasma, broulik, hpereiradacosta

Subscribers: plasma-devel

Tags: #plasma

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

M  +2    -1    kstyle/breezeshadowhelper.cpp
M  +3    -3    kstyle/breezeshadowhelper.h

http://commits.kde.org/breeze/088c7672981ba6d4b83946a280683764ce300d60
Comment 8 Martin Flöser 2016-11-07 10:47:40 UTC
Git commit a0433d089aa96ff60b625be10082e914c19b58d3 by Martin Gräßlin.
Committed on 07/11/2016 at 10:47.
Pushed by graesslin into branch 'Plasma/5.8'.

[kstyle] Implement application unpolish to delete ShadowHelper

Summary:
Another change mostly for KWin (Wayland compositor). KWin destroys it's
internal Wayland connection prior to the QStyle getting destroyed. As
the ShadowHelper initialized Wayland objects those would be destroyed
after the connection is destroyed. With latest Wayland library this
would cause a crash.

Thus unpolish is implemented in the style and deletes the ShadowHelper.
KWin can on tear down invoke the unpolish and thus make sure it doesn't
crash.

Reviewers: #plasma, broulik, hpereiradacosta

Subscribers: plasma-devel

Tags: #plasma

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

M  +15   -0    kstyle/breezestyle.cpp
M  +6    -1    kstyle/breezestyle.h

http://commits.kde.org/breeze/a0433d089aa96ff60b625be10082e914c19b58d3