since from Qt 5.8 QtWayland destroys its surfaces every time
a window gets hidden and recreates them again when is shown
(that's how the protocol is defined) install the shadows
every time the window is shown, using a map to keep track of surfaces, in order to delete them on window hide and avoid leaks
Details
- Reviewers
hpereiradacosta - Group Reviewers
Plasma - Commits
- R31:d4940fe692c7: make shadows work on wayland
R31:7db2aa9fcddd: Fixed compilation when KWayland is not there.
popup menus have correct shadows on wayland now
Diff Detail
- Repository
- R31 Breeze
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
We're going to be leaking both Surface and Shadow objects in installWaylandFilter, no?
kstyle/breezeshadowhelper.cpp | ||
---|---|---|
177 | we use Expose everywhere else, why not here? It gets called a lot less | |
185 | why not just remove the widget from the list? | |
472 | this is currently leaking? fromWindow constructs a new QObject | |
475 | this is going to be effectively leaking. on a show/hide/show we'll get now have two of these in memory, just one not attached to anything. | |
490–491 | off topic, but why do we have a commit on the surface? We haven't changed the surface, just attaced something to it. |
kstyle/breezeshadowhelper.cpp | ||
---|---|---|
174 | We make check on every event for what we know what it is, does it better to use polymorphic helper? |
kstyle/breezeshadowhelper.cpp | ||
---|---|---|
177 | Also, instead of using first "contains" then .value, one should really use an iterator (to avoid parsing the map twice): auto&& iter = _widgets.find( widget ); Something like that. |
This breaks builds on Neon and Kubuntu CI (Qt 5.7.1)
http://build.neon.kde.org/job/xenial_unstable_plasma_breeze_bin_amd64/120/console
05:10:59 In file included from /workspace/build/build-qt4/kstyle/moc_breezeshadowhelper.cpp:9:0,
05:10:59 from /workspace/build/build-qt4/kstyle/breeze_automoc.cpp:33:
05:10:59 /workspace/build/build-qt4/kstyle/../../kstyle/breezeshadowhelper.h:162:24: error: ‘KWayland’ was not declared in this scope
05:10:59 QMap<QWidget*, KWayland::Client::Surface *> _widgetSurfaces;
05:10:59 ^
05:10:59 /workspace/build/build-qt4/kstyle/../../kstyle/breezeshadowhelper.h:162:51: error: template argument 2 is invalid
05:10:59 QMap<QWidget*, KWayland::Client::Surface *> _widgetSurfaces;
! In D5910#114781, @hpereiradacosta wrote:
Working on fixing it.
Just a couple of ifdef missing.
The fix you just pushed seems to have done the trick. Thank you.