Skip to main content

Module overlay

Module overlay 

Source

Functionsยง

centered_windowed_rect
Shrink monitor to fraction of its size and centre it inside the original. fraction is clamped to [0.1, 1.0]. Used to size the BreakDelivery::Windowed overlay so the desktop stays clickable around it.
deliver_break
Surface a break through whichever channel the active settings ask for: a system notification or the overlay (full-screen or windowed). Notification delivery short-circuits the overlay path entirely.
ensure_overlay ๐Ÿ”’
fire_break
Build a BreakEvent, stash it in current_break, position an overlay window on each selected monitor, and emit break:start to the renderer. Used directly for sleep/resume-last paths; normal scheduled breaks go through deliver_break instead.
format_break_duration
Human-friendly break duration for notifications (e.g. "20 seconds", "5 minutes", "1m 30s"). Drops the seconds part when the duration is a whole-minute multiple.
notify_break_now ๐Ÿ”’
pick_active_monitor
Index of the monitor that contains (cursor_x, cursor_y), or None if the cursor sits outside every rect. Used by MonitorPlacement::Active to decide which display the overlay should pop on.
select_overlay_monitors ๐Ÿ”’