Skip to content

feat(linux): window decorations toggle + custom close button#84

Closed
nephalemsec wants to merge 2 commits into
mainfrom
linux/window-decorations
Closed

feat(linux): window decorations toggle + custom close button#84
nephalemsec wants to merge 2 commits into
mainfrom
linux/window-decorations

Conversation

@nephalemsec

Copy link
Copy Markdown
Collaborator

A small, self-contained Linux feature plus one dev-server fix — built on current main so it stays easy to rebase.

Window decorations toggle (Linux)

A window_decorations general setting (default on). Toggling it off removes the native titlebar and shows a custom in-app close button in the Settings titlebar — handy on tiling WMs (Hyprland/Sway) where the native frame is unwanted.

  • config: window_decorations field (serde default true), unioned into the existing GeneralConfig
  • capabilities: adds core:window:allow-set-decorations (+ minimize/maximize). Without it getCurrentWindow().setDecorations() silently no-ops — that was the subtle gotcha.
  • lib.rs: applies the saved preference at startup (Linux only)
  • Overview: a "Window Decorations" switch beside "Show in Dock", gated to Linux
  • WindowControls.svelte: the custom close button (hides to tray, matching native close)

Dev fix: keep Tailwind out of Svelte component styles

On main's stack (Vite 8.0.16 + @tailwindcss/vite 4.3 + vite-plugin-svelte 7), the Tailwind transform matches Svelte's &lang.css virtual modules and intermittently gets the raw .svelte source, throwing Invalid declaration: \invoke`500s in the dev server. The fix excludes.svelte?modules from Tailwind's transform. No component style uses Tailwind directives (sole entry issrc/app.css), so **built output is unchanged** — confirmed pnpm build` is identical.

Testing

  • cargo check --tests --features parakeet — clean; cargo fmt --check — clean
  • pnpm check (svelte-check) — 0 errors; pnpm build — clean
  • Diff is additive (106 insertions, 1 deletion); no reformatting noise

Note on scope

Parakeet and global shortcuts are intentionally not here — main already covers them (the official sherpa-onnx crate builds on Linux, and the wayland_portal/conflict.rs shortcut stack is current). This PR only adds what main is actually missing, to avoid re-treading ground upstream already owns.

Add a `window_decorations` general-setting (default on). When toggled off on
Linux the native titlebar is removed and a custom in-app close button
(WindowControls, in the Settings titlebar) takes over — useful on tiling WMs.

- config: window_decorations field (serde default true)
- capability: core:window:allow-set-decorations (+ minimize/maximize); without
  it setDecorations() silently no-ops
- lib.rs: apply the saved preference at startup (Linux)
- Overview: a "Window Decorations" Switch beside "Show in Dock" (Linux only)
- Settings: custom close button shown when decorations are off
Under Vite 8 + @tailwindcss/vite 4.3 + vite-plugin-svelte 7, the Tailwind
transform matches Svelte's `&lang.css` virtual modules and intermittently
receives the raw `.svelte` source, throwing `Invalid declaration: \`invoke\``
500s in the dev server. Exclude `.svelte?` modules from Tailwind's transform —
no component style uses Tailwind directives (sole entry is src/app.css), so
output is unchanged.
@nephalemsec

Copy link
Copy Markdown
Collaborator Author

Superseded by #86 (linux/everything), which contains every commit from this branch plus the rest of the Linux/Wayland work in one consolidated PR. Closing to keep a single branch.

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