D26475: [kstyle] Port to KWindowSystem shadows API
Vlad Zahorodnii
noreply at phabricator.kde.org
Sun Jan 12 18:54:01 GMT 2020
zzag updated this revision to Diff 73349.
zzag added a comment.
Re-write the entire port :/
In case of server-side drop-shadows, we don't want to destroy KWindowShadow
before QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed is emitted, otherwise
the associated window will be shadow-less when it's being animated by the
compositor.
In general, we need to clean up KWindowShadow internals when QWindow sends
QPlatformSurfaceEvent::SurfaceDestroyed or something, but unfortunately Qt
has no such event. :(
I would say that this use-case is pretty weird (I mean the intentional
resource leak). On the other hand, having release() or something that says
"I want to leak resource blah-blah" is also weird.
It would be great to have the following event filter
bool ShadowHelper::eventFilter(QObject *watched, QEvent *event)
{
if (event->type() == QEvent::PlatformSurface) {
QWidget *widget = static_cast<QWidget *>(watched);
QPlatformSurfaceEvent *surfaceEvent = static_cast<QPlatformSurfaceEvent *>(event);
switch (surfaceEvent->surfaceEventType()) {
case QPlatformSurfaceEvent::SurfaceCreated:
installShadows(widget);
break;
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
// Don't care.
break;
case QPlatformSurfaceEvent::SurfaceDestroyed:
uninstallShadows(widget); // will do nothing but cleanup
break;
}
}
return false;
}
REPOSITORY
R31 Breeze
CHANGES SINCE LAST UPDATE
https://phabricator.kde.org/D26475?vs=72924&id=73349
BRANCH
port-to-shadows-api
REVISION DETAIL
https://phabricator.kde.org/D26475
AFFECTED FILES
kstyle/breezeshadowhelper.cpp
kstyle/breezeshadowhelper.h
To: zzag, #kwin, #plasma, mart
Cc: mart, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200112/75aecd41/attachment.html>
More information about the Plasma-devel
mailing list