Introduce shadows API
AcceptedPublic

Authored by zzag on Mon, Jan 6, 10:30 AM.

Details

Reviewers
davidedmundson
Group Reviewers
KWin
Maniphest Tasks
T12496: Shadows API in KWindowSystem
Summary

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.

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
zzag created this revision.Mon, Jan 6, 10:30 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMon, Jan 6, 10:30 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
zzag requested review of this revision.Mon, Jan 6, 10:30 AM
zzag updated this revision to Diff 72880.Mon, Jan 6, 12:44 PM

Remove pointless default member initializers in KWindowShadowPrivate.

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.

zzag added inline comments.Mon, Jan 6, 1:23 PM
src/kwindowshadow.h
202

Could you please point me to that code?

davidedmundson added inline comments.Mon, Jan 6, 1:28 PM
src/kwindowshadow.h
202

kwayland-integration

0a0c3f23fce265f36e5b8fb2b4b8bd311c7c1beb
src/windowsystem/windoweffects.cpp

zzag added inline comments.Mon, Jan 6, 1:37 PM
src/kwindowshadow.h
202

Oh, that one... Yeah, perhaps it will be worth to handle surface creation/destruction in kwayland-integration.

zzag added inline comments.Mon, Jan 6, 6:33 PM
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...

zzag updated this revision to Diff 73352.EditedSun, Jan 12, 6:58 PM
  • 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
zzag retitled this revision from Introduce shadow API to Introduce shadows API.Sun, Jan 12, 7:27 PM
zzag updated this revision to Diff 73728.Thu, Jan 16, 5:57 PM

No noexcept

noexcept is a very rare thing to see in KF code so let's not deviate too much.

zzag updated this revision to Diff 73733.Thu, Jan 16, 6:12 PM

Update doc.

davidedmundson accepted this revision.Fri, Jan 17, 11:22 AM

Good stuff!

src/platforms/xcb/kwindowshadow_p_x11.h
45

We typically have an m_ prefix for member variables

*3

This revision is now accepted and ready to land.Fri, Jan 17, 11:22 AM