Skip to content

feat(windows): a Settings dialog from the tray and title-bar menu, and yserver's icon - #330

Merged
joske merged 3 commits into
masterfrom
feat/windows-settings
Nov 4, 2026
Merged

joske merged 3 commits into
masterfrom
feat/windows-settings

Conversation

@joske

@joske joske commented Nov 4, 2026

Copy link
Copy Markdown
Owner

On Windows, yserver has a Settings dialog, like the macOS one, and uses its own icon instead of the generic Windows one.

  • Opening it: from the tray icon, which now appears in rooted mode too, or from the rooted window's title-bar menu (right-click). The tray menu has Settings… and Exit.
  • The settings:
    • the X display, with a Copy button;
    • rootless or one window for the X screen;
    • clipboard sync;
    • start yserver when you sign in (the per-user Run registry key).
  • Applying them:
    • Clipboard sync applies at once. The mode applies when you restart, through the dialog's Restart button.
    • Options given on the command line are shown greyed out.
    • Restart relaunches with the same arguments, so -auth is kept.
  • Default mode: saved settings apply at every start, so plain yserver.exe now starts rootless by default, as on macOS. --rooted and --rootless override that for one run.
  • Where they're saved: %APPDATA%\yserver\settings.conf.
  • Not on Windows: Scale (yserver isn't DPI-aware yet), and the Mac-only button emulation and key equivalents.
  • Keys: in rooted mode, Alt+Space, F10 and a lone Alt go to X clients, not to the Windows window menu, so an X window manager's own Alt+Space menu still works.
  • The icon: assets/yserver.ico, made from the existing SVG, is embedded in yserver.exe, so Explorer and the taskbar show it. The tray and both window types use it.

Verification:

  • Unit tests for the settings file format and for how the Run key quotes its command line. The quoting test vectors were checked against Windows' own CommandLineToArgvW.
  • In a Windows 11 VM, rooted and rootless:
    • the dialog opens from the tray and from the title-bar menu;
    • Copy puts the display on the clipboard;
    • with clipboard sync off, copy and paste stops crossing in both directions, and resumes when it's turned back on;
    • start at sign-in writes the Run value and removes it again;
    • the chosen mode survives a restart;
    • xev receives Alt+Space, F10 and a lone Alt.
  • Builds: Linux formatting, clippy and tests pass, and Windows clippy is clean. This PR's CI has no Windows job yet; the next PR adds one and builds this code.

🤖 Generated with Claude Code

joske and others added 3 commits November 4, 2026 16:32
…d the rooted window's system menu

The dialog mirrors the macOS Settings window: the X display with Copy,
mode, scale, clipboard sync and start at sign-in (the HKCU Run value),
plus Restart, which starts yserver again with the same arguments. Live
options apply at once, mode and scale at the next start. The settings
are stored as key=value lines in %APPDATA%\yserver\settings.conf and
apply under argv at every launch, so a launch without --rooted is now
rootless by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
assets/yserver.ico (16 to 256 px, from yserver-icon.svg) is resource 1 of
yserver.exe through yserver.rc and embed-resource on windows-msvc, and is
loaded at the system's icon sizes for the window classes and the tray.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The window menu now opens only from the title bar, as before Settings;
the keyboard's way into it is ignored. Scale is not shown until the
process is DPI-aware, where it would change nothing; its stored value
is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joske
joske merged commit d3a9314 into master Nov 4, 2026
19 of 23 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