
This fixes a bug which happens if screen time limits are *disabled* and the history file (`~/.local/share/gnome-shell/session-active-history.json`) is missing when gnome-shell is started. If so, the code would previously have incorrectly called `this._stopStateMachine()` on startup, even though the state machine wasn’t running. This adds a fake transition from ACTIVE to INACTIVE to the history file. If the user later (that day) enables time limits, the code assumes that they were active from the start of the day through to that fake transition, which is possibly sufficient time to reach the user’s limit already. This results in the screen immediately being made greyscale as the limit has apparently been reached. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8155 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3597>