Skip to content

Precise user-idle detection for retreat (ext-idle-notify) #2

Description

@NovusEdge

Context

The retreat behavior (pet ambles to a corner and sleeps) has two intended triggers:

  • A — rare cadence (~every 30 min of runtime): implemented / planned as the reliable path.
  • B — user inactivity (~5 min of no input → sleep until the user returns): stubbed for now.

Why B is stubbed

goob is a click-through overlay with mouse passthrough clipped to the pet's rect, so the app never sees the global cursor when it's off the pet — we can't measure idleness from cursor movement. And on the dev machine (KDE Plasma / kwin_wayland), the easy system idle sources don't work on Wayland:

  • org.freedesktop.ScreenSaver.GetSessionIdleTimeNotSupported on Wayland (X11-only).
  • logind IdleHint stays no / only flips at the coarse system idle timeout.
  • No swayidle/kidletime present.

The proper cross-compositor signal is the ext-idle-notify-v1 Wayland protocol (KWin supports it), which needs a native Wayland client — a small GDExtension or an external helper binary invoked from Godot.

Task

Implement Trigger B via a real idle source:

  • ext-idle-notify-v1 helper (GDExtension or external process that emits idle/resume events), or a best-effort logind IdleHint poll where it works.
  • Wire it into the stubbed retreat idle hook in the behavior engine.
  • Feature-detect and degrade gracefully (cadence-only) when no idle source is available.

Until then, retreat runs on the cadence trigger only.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions