6 Commits

Author SHA1 Message Date
Philip Withnall
554af00a6d breakManager: Activate wellbeing settings on clicking notification
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8305
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3685>
2025-04-28 15:52:14 +00:00
Philip Withnall
5d1157cdfa breakManager: Switch from lightbox to a Clutter effect for fading out
From some testing on a full session with break reminders enabled, it
seems that it’s possible to break the stacking order of the lightbox
actor if the user continues to interact with the session while it’s
visible (for example, while they’re supposed to be taking a movement
break).

Rather than try and work out what’s going on with the lightbox here, it
seems more robust to switch to using a Clutter effect, like we did with
the screen time UI (in `timeLimitsManager`). Then the effect can be
applied to the main UI group, and doesn’t depend on a separate actor
being placed in the right place in the scene graph.

So, remove the lightbox, and instead add a
`ClutterBrightnessSaturationEffect`, and use its brightness property to
fade the screen slightly while in breaks.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3655>
2025-03-05 12:06:07 +00:00
Philip Withnall
e950697156 breakManager: Allow break to be taken or delayed when overdue
This makes the buttons on the ‘break overdue’ notification match those
on the ‘time to take a break’ notification. This makes more sense than
showing no buttons on the former, because it leads on from the ‘time to
take a break’ notification after a short wait.

By adding a ‘Take’ button it gives the user a path to acknowledge that
they are starting to take their break, rather than having to let the
session idle.

The ‘break overdue’ notification wasn’t on the original design[1], which is
probably why its buttons got overlooked.

[1]: https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3656>
2025-03-04 18:42:41 +00:00
Florian Müllner
b75b4abaf0 js: Set BoxLayout orientation
Use new `orientation` property instead of `vertical`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
cbfcf17002 breakManager: Fix (un)inhibiting unredirection
The BreakManager is a relatively recent addition, which is probably
why commit 4034e69d0d8e1 missed it.

Fixes: 4034e69d0d ("Adapt to fixed Meta functions namespace")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3575>
2024-12-16 14:52:11 +01:00
Philip Withnall
df3b4d302d breakManager: Add new state machine for screen time/health breaks
This implements health break reminder support in gnome-shell. It depends
on a
few bits and bobs from other modules:
 - New settings schemas in gsettings-desktop-schemas (released in
   47.beta, which Mutter already depends on)
 - A settings UI in gnome-control-center
 - User documentation in gnome-user-docs

It implements the design from
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png.

The core of the implementation is `BreakManager`, which is a state
machine which uses the Mutter `IdleMonitor` to track whether the user
is, or should be, in a screen time break.

The `BreakDispatcher` is based on top of this, and controls showing
notifications, countdown timers, screen fades, the lock shield, etc. to
make the user aware of upcoming or due breaks, as per their notification
preferences.

Unit tests are included to check that `BreakManager` works. These
provide mock implementations of basic GLib clock functions, the
`IdleMonitor` and `Gio.Settings` in order to test the state machine in
faster-than-real-time.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

See: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/130
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3251>
2024-11-28 10:44:10 +00:00