PanelShadow: Don't remove shadows from destroyed windows
ClosedPublic

Authored by drosca on Feb 15 2016, 9:05 PM.

Details

Summary

If the window's platform surface was destroyed, there is also
no shadow to be removed.
Both X and Wayland code will try to create the platform surface
again, and it will lead to crash in other code that doesn't expect
platform surface to be created when the containment is being deleted.

This fixes crash in PanelConfigView::event when removing panels.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
drosca updated this revision to Diff 2313.Feb 15 2016, 9:05 PM
drosca retitled this revision from to PanelShadow: Don't remove shadows from destroyed windows.
drosca updated this object.
drosca edited the test plan for this revision. (Show Details)
drosca added reviewers: Plasma, graesslin.
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 15 2016, 9:05 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin edited edge metadata.Feb 16 2016, 6:54 AM

Maybe we could connect to the PlatformSurfaceDestroyed event? At that point it's still valid and we can call into clearShadow?

shell/panelshadows.cpp
630

shouldn't it be a dynamic_cast in this case?

That could work too, but is it really needed to remove shadow (one property) from the window that is going to be destroyed right after?

drosca added inline comments.Feb 16 2016, 8:46 AM
shell/panelshadows.cpp
630

QWindow derives from QSurface, so dynamic_cast would not make a difference here?

In D951#18409, @drosca wrote:

That could work too, but is it really needed to remove shadow (one property) from the window that is going to be destroyed right after?

yes as otherwise on X11 we are leaking pixmaps and on Wayland we are leaking buffers on both client and server.

drosca updated this revision to Diff 2318.Feb 16 2016, 9:08 AM
drosca edited edge metadata.

Remove shadows on SurfaceAboutToBeDestroyed

graesslin accepted this revision.Feb 16 2016, 9:50 AM
graesslin edited edge metadata.
This revision is now accepted and ready to land.Feb 16 2016, 9:50 AM
This revision was automatically updated to reflect the committed changes.