[effects/diminactive] Delete active transitions when window is deleted
ClosedPublic

Authored by zzag on Oct 11 2018, 2:48 PM.

Details

Summary

The Dim Inactive effect expects that the windowClosed signal always
proceeds the windowDeleted signal. But in some cases that's not the case.

If a window gets destroyed before becoming ready for painting, only
the windowDeleted signal will be emitted. In addition to that, KWin will
activate that window, which means we'll probably start a transition for
it.

Because this effect cannot terminate active transitions for such
windows, KWin can crash in postPaintScreen.

This change addresses the crash in postPaintScreen by adding extra clean
up stuff in the windowDeleted slot to make sure that there are no
transitions for already gone windows.

The proper fix would be to not emit windowActivated signal for windows
that are not ready for painting.

BUG: 399612
FIXED-IN: 5.14.1

Test Plan

Ran

x <- seq(5, 15, length=1000)
y <- dnorm(x, mean=10, sd=3)
plot(x, y, type="l", lwd=1)

in RKWard many times.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Oct 11 2018, 2:48 PM
Restricted Application added a project: KWin. · View Herald TranscriptOct 11 2018, 2:48 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Oct 11 2018, 2:48 PM
zzag edited the test plan for this revision. (Show Details)Oct 11 2018, 2:49 PM
zzag edited the summary of this revision. (Show Details)Oct 11 2018, 2:51 PM
davidedmundson accepted this revision.Oct 11 2018, 2:52 PM
This revision is now accepted and ready to land.Oct 11 2018, 2:52 PM
This revision was automatically updated to reflect the committed changes.
zzag added a comment.Oct 11 2018, 2:55 PM

Argh, I forgot to run arc amend.

Good detection work! The problem you describe is btw. quite common. I remember that any Qt file open dialog caused this behavior. It first created the window than closed it and created it again. That was one of the first very painful Wayland crashers I investigated.

zzag added a comment.Oct 11 2018, 4:53 PM

Good detection work! The problem you describe is btw. quite common. I remember that any Qt file open dialog caused this behavior. It first created the window than closed it and created it again.

Do you know why they do that?

In D16130#341384, @zzag wrote:

Good detection work! The problem you describe is btw. quite common. I remember that any Qt file open dialog caused this behavior. It first created the window than closed it and created it again.

Do you know why they do that?

I had a theory (no idea whether it's true): the file open dialog is provided by the qpt plugin and due to that first the Qt dialog is created and afterwards the qpt dialog.