Skip to content

plugins/nightlight: Make Night Light more robust to QTimer firing slightly earlier

Vlad Zahorodnii requested to merge work/zzag/night-light-more-fuzzy-time into master

Currently, resetSlowUpdateTimers() will start a timer that will pass m_next.first as the current time to resetSlowUpdateTimers(). This kind of works, but there are more code paths where updateTransitionTimings() can be called.

This change hardens updateTransitionTimings() against the current time being very close to the start of the next transition by introducing a time fudge factor.

If we are currently 1 second away from the start of the next transition, then it is assumed that that transition has been reached, and we need to calculate the timings of a transition after that.


Targeting 6.1.1

Merge request reports