<table><tr><td style="">zzag updated this revision to Diff 73349.<br />zzag added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D26475">View Revision</a></tr></table><br /><div><div><p>Re-write the entire port :/</p>
<p>In case of server-side drop-shadows, we don't want to destroy KWindowShadow<br />
before QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed is emitted, otherwise<br />
the associated window will be shadow-less when it's being animated by the<br />
compositor.</p>
<p>In general, we need to clean up KWindowShadow internals when QWindow sends<br />
QPlatformSurfaceEvent::SurfaceDestroyed or something, but unfortunately Qt<br />
has no such event. :(</p>
<p>I would say that this use-case is pretty weird (I mean the intentional<br />
resource leak). On the other hand, having release() or something that says<br />
"I want to leak resource blah-blah" is also weird.</p>
<p>It would be great to have the following event filter</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">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;
}</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R31 Breeze</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D26475?vs=72924&id=73349">https://phabricator.kde.org/D26475?vs=72924&id=73349</a></div></div><br /><div><strong>BRANCH</strong><div><div>port-to-shadows-api</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26475">https://phabricator.kde.org/D26475</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kstyle/breezeshadowhelper.cpp<br />
kstyle/breezeshadowhelper.h</div></div></div><br /><div><strong>To: </strong>zzag, KWin, Plasma, mart<br /><strong>Cc: </strong>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<br /></div>