[style] Reparent window shadows to widgets

Authored by zzag on May 21 2020, 12:16 PM.

Description

[style] Reparent window shadows to widgets

We want to destroy a shadow after its decorated window has been destroyed
or unmapped. In order to do that, we install an event filter on the widget
and make the shadow a child of the window.

Unfortunately, the underlying window and the widget have different life
times. To counter for that, we clean up _shadows after the shadow has
been destroyed. This turned out to be a bad idea because when someone
does qDeleteAll(_shadows), QMap iterators will become invalid.

Since KWindowShadow handles the case where the native resources for the
window have been released well, we can keep shadows as children of
widgets. This will simplify object hierarchy and fix invalid iterators
when ShadowHelper destroys all shadows with qDeleteAll().

Still, it would be nice to call KWindowShadow::destroy() after the native
resources for the window have been released.

Details

Committed
zzagMay 21 2020, 12:31 PM
Parents
R113:ec42d2c0399b: Update version number for 5.18.90 GIT_SILENT
Branches
Unknown
Tags
Unknown
References
refs/backups/branch-work/fix-shadow-crash-1590070704