The new API provides a platform-independent way for setting drop-shadows
on a window. X11 and Wayland details are completely hidden from the users
of the new API, but you still need to be cautious about QPAs that destroy
the underlying native resources(e.g. wl_surface) upon a window becoming
hidden. It is highly recommended to install an event filter that reacts
to events of type QEvent::PlatformSurface.
Details
- Reviewers
davidedmundson - Group Reviewers
KWin - Maniphest Tasks
- T12496: Shadows API in KWindowSystem
- Commits
- R278:493452e98f99: Introduce shadows API
Diff Detail
- Repository
- R278 KWindowSystem
- Branch
- kwindowshadow
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 21252 Build 21270: arc lint + arc unit
Seems generally very clean and sensible. +1
I want to see plasma-framework/dialog.cpp and breeze ports before we merge.
src/kwindowshadow.h | ||
---|---|---|
202 | For KWindowEffects I did put window tracking into the wayland plugin and it improved the readability of all the client code considerably. I would recommend looking at doing so, especially as we could probably even share the implementation that kwayland-integration windoweffects.cpp has. |
src/kwindowshadow.h | ||
---|---|---|
202 | Could you please point me to that code? |
src/kwindowshadow.h | ||
---|---|---|
202 | kwayland-integration 0a0c3f23fce265f36e5b8fb2b4b8bd311c7c1beb |
src/kwindowshadow.h | ||
---|---|---|
202 | Oh, that one... Yeah, perhaps it will be worth to handle surface creation/destruction in kwayland-integration. |
src/kwindowshadow.h | ||
---|---|---|
202 | Okay, looks like it's do-able. However, we would need to call QWidget::winId() in Breeze::ShadowHelper::installShadows() to create a QWindow... |
- Make KWindowShadow a QObject subclass (for memory management)
- Clarify that it is okay to call destroy() after window() had been destroyed
- Check whether QWindow has QPlatformWindow associated with it
No noexcept
noexcept is a very rare thing to see in KF code so let's not deviate too much.
Good stuff!
src/platforms/xcb/kwindowshadow_p_x11.h | ||
---|---|---|
45 | We typically have an m_ prefix for member variables *3 |