Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jul 23, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

deltragon added 11 commits July 23, 2025 20:14
This fixes two issues:
- There was something going wrong with cleaning up the wayland
  connection/objects, and sometimes the ext_idle_notify object would be
  either gone or outright segfault. The resource management should be
  more obvious and easier to follow now.
- When running on a compositor without support for ext-idle-notify-v1,
  the idle_time would just silently be 0. Now we at least log a message,
  with the potential for displaying a warning in the settings.
…sses

This commit really does two things:
- Separate the different implementations into classes.
  Add a common interface, and implement it with a separate class for
  each implementation (x11, gnome, swayidle, ext-idle-notify).
- Refactor for performance/battery life.
  Previously, the plugin would poll every 2 seconds to check the idle
  time. This is necessary on X11, as there is no better API. However,
  for the other platforms, it is possible to simple listen for events,
  saving a lot of unnecessary wakeups (especially while idle).
  The common interface was strongly influenced by this.
  This does however mean that the gnome and swayidle implementations
  were heavily refactored as well, to make use of the event model.

It's pretty hard to split those two things up. It would be possible in
theory, but it'd be a lot of work, and the intermediate state would
either look nothing like the start or end, or just be broken.
smartpause: refactor into multiple classes
pytest: add tests for Break and BreakQueue
@pull pull bot locked and limited conversation to collaborators Jul 23, 2025
@pull pull bot added the ⤵️ pull label Jul 23, 2025
@pull pull bot merged commit 033ea9e into Uncodedtech:master Jul 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant