Skip to content

Fix idle notify and Wayland click-to-focus - #2

Merged
gabparrot merged 2 commits into
mainfrom
fix-idle-click
Aug 20, 2026
Merged

Fix idle notify and Wayland click-to-focus#2
gabparrot merged 2 commits into
mainfrom
fix-idle-click

Conversation

@gabparrot

Copy link
Copy Markdown
Owner

Summary

  • Idle notify now starts a turn on a new user message, not only session.status busy, so a finished agent still pops if busy never arrived.
  • Notification clicks on GNOME/Wayland pass the XDG activation token and line-buffer gdbus monitor.
  • Drop desktop-entry: dev.zed.Zed so GNOME does not swallow the click without focusing Flatpak Zed.

Test plan

  • bun run typecheck
  • bun test
  • Restart OpenCode, finish a turn, confirm opencode idle appears
  • Click the popup and confirm the existing Zed window focuses

Treat a user message as the start of a turn so idle still fires when
session.status busy is missing. On Linux, line-buffer gdbus monitor,
use the GNOME activation token, and drop desktop-entry so the click
reaches us instead of failing to raise Flatpak Zed.
Assert the XDG activation token is passed through spawn env, and drop
stale tokens when a notification is closed.
@gabparrot

Copy link
Copy Markdown
Owner Author

Reviewed the idle-turn + Wayland click path.

Fixed on the branch:

  • stdbuf had no fallback, so a missing binary (or spawn error) left click-to-focus dead. Watch now falls back to gdbus monitor.
  • Tests did not assert XDG_ACTIVATION_TOKEN on spawn, so the Wayland focus path could regress silently.
  • close() now drops the stored activation token with the click id.

Idle beginTurn marking the session active looks right, and firing on ActivationToken (then ignoring the later ActionInvoked) matches GNOME.

@gabparrot
gabparrot merged commit 8b0c8fb into main Aug 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant