Remove composite reset timer
ClosedPublic

Authored by romangg on Jul 4 2019, 1:51 PM.

Details

Summary

To streamline Compositor code more remove the composite reset timer. The two
times it was used we can either use a singleshot timer instead or connect the
call to a different signal in the X11 backend.

Long term goal is to have a well structured init of the Compositor such that
we can call directly instead.

Test Plan

Manually in X and Wayland nested session.

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.
romangg created this revision.Jul 4 2019, 1:51 PM
Restricted Application added a project: KWin. · View Herald TranscriptJul 4 2019, 1:51 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Jul 4 2019, 1:51 PM

The connect in the X11 backend instead of using the timer should have the same effect, since it's proxied through this startChangedTimer at the beginning of the event receiver.

zzag added a subscriber: zzag.Jul 4 2019, 3:30 PM

So, with this patch, Screens' m_changeTimer is used to compress composite resets, is it correct?

plugins/platforms/x11/standalone/screens_xrandr.cpp
56

comp -> compositor

In D22270#490867, @zzag wrote:

So, with this patch, Screens' m_changeTimer is used to compress composite resets, is it correct?

Yea, exactly. After the Compositor class has been split up and the Screens class has been removed it might make sense to add a compress timer back to the Compositor's X child class. For now I just want it gone to have less moving parts for the split up.

zzag added inline comments.Jul 4 2019, 3:52 PM
composite.cpp
115
connect(&compositeResetTimer, &QTimer::timeout, this, &Compositor::reinitialize);
compositeResetTimer.setSingleShot(true);

Only initializes the timer. I suppose we can drop this QTimer::singleShot thing, otherwise Compositor will be reinitialized (with no absolute good reason) several times during startup.

zzag added inline comments.Jul 4 2019, 4:03 PM
composite.cpp
115

... unless I'm missing something. It's not obvious why QTimer::singleShot is here.

romangg added inline comments.Jul 4 2019, 4:06 PM
composite.cpp
115

No, you're right definitely. I just misread the old code.

romangg updated this revision to Diff 61154.Jul 4 2019, 4:18 PM

No reinit in Compositor cnstr.

romangg marked 4 inline comments as done.Jul 4 2019, 4:18 PM
zzag accepted this revision.Jul 4 2019, 4:54 PM
This revision is now accepted and ready to land.Jul 4 2019, 4:54 PM
This revision was automatically updated to reflect the committed changes.