Repository navigation
fix(notifications): suppress focused notifications and activate posting window on Linux - #1394
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1295.
Credit to @zce for the root-cause analysis and proposed design.
What changed
on_focusinapps/desktop/src/workspace/windows/(Open::has_focus,windows::set_focused,windows::any_focused,windows::app_focused), clearing focus when a window hides or closes.NotificationsHost::is_window_focused()onAppand updateApp::poll_taskbar()to callwindows::app_focused(self). On macOS and Windows this still delegates directly torune_notify::app_focused(); on Linux, whererune_notify::app_focused()returnsfalseunconditionally, it uses the tracked window focus state so notifications and waiting alerts are suppressed while focused.NotificationsHost::activate_window(&mut self, token: Option<&str>)(defaulting torune_notify::bring_to_front()) and passclick.activation_token()fromfeatures/notifications/src/lib.rs::pollfor toast-body and extension notification clicks while keeping inline permission/question button clicks answer-only.App::activate_windowforwards non-empty tokens to the posting window'sWindowHandle::activate(token)(available in the currently pinned Rune revision viaanomalyco/rune#2502) and falls back toWindowHandle::focus()when no token is present. macOS and Windows continue callingrune_notify::bring_to_front().Verification
pwsh scripts/guardrails.ps1— passed (10/10).cargo check -p opencode-feature-notifications— passed.cargo clippy --no-deps -p opencode-feature-notifications -- -D warnings— passed.apps/desktopcompile (nonasminstalled on this Windows machine forrav1d) and live Linux Wayland/X11 desktop hardware (GNOME/mutter) were not run locally.