Don't destroy DecorationRenderer in setup/finish compositing
ClosedPublic

Authored by zzag on Feb 11 2019, 10:36 AM.

Details

Summary

Currently, KWin/Wayland crashes when the compositor is reinitialized.
The reason for that is ShellClient's DecorationRenderer gets destroyed
when the scene is already gone, thus there is no current OpenGL context.
Client works around that issue by destroying scene-specific DecorationRender
in finishCompositing. Such a workaround could be applied to ShellClient
as well, but it would make code more confusing because DecoratedClientImpl
also tries to destroy DecorationRenderer.

A better approach would be to notify DecoratedClientImpl that
compositing is about to be finished, so it can destroy the decoration
renderer when the scene is still alive. This not only fixes the
previously mentioned issue in ShellClient, but also makes code a little
bit tidier.

Test Plan

Start Plasma on Wayland session, change any compositor settings (e.g.
animation speed).

Diff Detail

Repository
R108 KWin
Branch
discard-deleted
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8150
Build 8168: arc lint + arc unit
zzag created this revision.Feb 11 2019, 10:36 AM
Restricted Application added a project: KWin. · View Herald TranscriptFeb 11 2019, 10:36 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Feb 11 2019, 10:36 AM
zzag updated this revision to Diff 51401.Feb 11 2019, 10:39 AM

Make DecoratedClientImpl::destroyRenderer private.

zzag updated this revision to Diff 51674.Feb 14 2019, 1:13 PM

Emit aboutToToggleCompositing before EffectsHandler is created or destroyed.

zzag updated this revision to Diff 51675.Feb 14 2019, 1:14 PM

Remove unrelated whitespace change.

zzag updated this revision to Diff 51679.Feb 14 2019, 2:03 PM

Emit aboutToToggleCompositing before the scene is created.

davidedmundson accepted this revision.Feb 20 2019, 10:45 AM
davidedmundson added a subscriber: davidedmundson.

Though with ShellClients we never really toggle compositing, it's used in a somewhat overkill way of reloading settings.
But I like how this cleans up Client.

This revision is now accepted and ready to land.Feb 20 2019, 10:45 AM
zzag added a comment.Feb 20 2019, 11:42 AM

Can it go in Plasma/5.15?

This revision was automatically updated to reflect the committed changes.