Skip to content

Let users pin a note window above other apps from the overflow menu - #7961

Merged
ComputelessComputer merged 2 commits into
mainfrom
devin/1790907505-always-on-top
Oct 2, 2026
Merged

ComputelessComputer merged 2 commits into
mainfrom
devin/1790907505-always-on-top

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Intent: Users taking notes during a meeting want the note window to stay visible over the meeting app. This adds an "Always on Top" toggle to the note "..." menu, right after "Open in New Window". It pins the current window, whether that's the main window or a standalone note window, and shows a check mark while it's on.

  • AlwaysOnTop remembers the last requested state in a module-level requestedAlwaysOnTop. Each Tauri window has its own webview, so this value is per-window and resets when the window is recreated. It only falls back to getCurrentWindow().isAlwaysOnTop() before the first toggle. On Linux, isAlwaysOnTop() returned false while _NET_WM_STATE_ABOVE was still set, so trusting it would reopen the menu unchecked and make the next click re-pin the window instead of unpinning it.
  • A click calls setAlwaysOnTop(next) optimistically, and both the check mark and the remembered value are reverted if that call fails.
  • Capabilities: adds core:window:allow-set-always-on-top and core:window:allow-is-always-on-top.
  • The setting isn't saved: it lasts only as long as the window stays open.
  • Known interaction: the main window's instruction flow (window_set_frame_animated / restore) still turns always-on-top on and then off on restore, and the check mark isn't updated to match. This only overrides the toggle while that flow runs.

Demo

Tested in a real Linux (KDE/X11) Tauri desktop build. After every change I checked _NET_WM_STATE_ABOVE with xprop, in both the main window and a standalone note window.

Menu reopened: check kept One click unpins
Main reopened checked Main disabled

Not tested on macOS or Windows.

Verification

  • pnpm -F desktop typecheck
  • pnpm -F desktop exec vitest run src/session/components/outer-header/overflow (35 passed; always-on-top.test.tsx covers enable → remount while isAlwaysOnTop reads false → still checked → one click calls setAlwaysOnTop(false))
  • pnpm -F desktop i18n:check
  • dprint / oxlint on the changed files
  • Manual (Linux desktop): enabling keeps the menu open and the window stays above a focused Chrome window. Reopening the menu keeps the check mark, and one click unpins. Main and standalone windows keep separate states, and a recreated standalone window starts unpinned.

Link to Devin session: https://app.devin.ai/sessions/d4f38fe85b7a4ff8b23b51fcb6749d88
Open in Devin Desktop: https://app.devin.ai/desktop/session/d4f38fe85b7a4ff8b23b51fcb6749d88?variant=devin
Requested by: @ComputelessComputer

Co-Authored-By: John <john@fastrepl.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Retested 21dc2cd3fc in a real Linux (Ubuntu 24 userspace, KDE/X11) Tauri desktop build. Reopening the menu no longer drops the check mark, in both the main and standalone windows.

Main reopened: check kept Standalone reopened: check kept
Main check kept Standalone check kept
  • PASS: starts unchecked; enabling keeps the menu open and sets native ABOVE.
  • PASS: both window types stay above a focused Chrome window.
  • PASS: reopening the menu keeps the check; one click unchecks and removes ABOVE.
  • PASS: main and standalone states are independent.
  • PASS: closing a pinned standalone window and reopening it starts unchecked and unpinned, and main is unchanged.
Console caveat and scope

Checked _NET_WM_STATE_ABOVE after each change and _NET_ACTIVE_WINDOW to confirm Chrome had focus. The logs still show the cyclic-JSON rejections from dev performance logging that were there before; there were no Always on Top read/set errors and no permission-denied errors. Not tested: rollback when the setter fails, and macOS/Windows.

Devin session

@ComputelessComputer
ComputelessComputer merged commit 87d534a into main Oct 2, 2026
17 of 18 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