Skip to content

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

Vlad Zahorodnii requested to merge work/cherry-pick-fef2bfb9 into Plasma/6.1

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.

(cherry picked from commit fef2bfb9)

Merge request reports

Loading