Skip to content

Releases

Windows Theme Switcher v2.1.3

Choose a tag to compare

@DashAkoul DashAkoul released this 27 Oct 17:41

v2.1.3 — third audit pass

A third review pass covering what the first two did not: multi-monitor placement, the dev scripts, the documentation, bundle assets and the dependency tree. Twelve findings, all fixed. Full report: docs/AUDIT.md.

Fixed: the popup opened on the wrong monitor

The window is created hidden with no position, so current_monitor() answered for wherever Windows happened to park it — on a multi-monitor setup that is usually the primary screen, not the one whose tray icon was just clicked. target_monitor() now picks the monitor under the cursor, falling back to current_monitor() and then primary_monitor().

Fixed: the smoke test script had been broken for a while

scripts/smoke_test.sh pointed at Windows Theme Switcher.exe, but the binary is named after the crate (windows-theme-switcher.exe), so it always failed with "binary not found" — and its comments still described a v1 onboarding window. It now checks the right path, that the process stays alive, that startup lands in the log, and that a second launch exits on its own. Cleanup uses taskkill, because kill does not terminate a Windows GUI process reliably.

Fixed: the error screen had no close button

If get_app_state failed, App.tsx rendered only the error body — no header, no ✕. The popup could only be dismissed by clicking outside, which looks like a broken window. The header is now a shared PanelHeader used by both screens.

Fixed: the testing guide described a different app

docs/TESTING.md claimed 13 MB idle and 45 MB after opening the panel, and its sample log quoted lines that no longer exist (starting in tray (no webview), panel created, applied profile 'dark' in 412ms). Anyone testing against it would have reported a false failure. Rewritten with the measured numbers and the real log strings, plus sections for multi-monitor, log rotation and invalid-config recovery.

Optimisation

  • crate-type reduced to ["rlib"] — staticlib/cdylib are only needed for the mobile targets this project does not build
  • unused favicon removed (a Tauri window has no tab strip)
  • the body scrolls when content exceeds the fixed height (large Windows text scaling), and the error text is selectable so it can be copied into a bug report

Dependency audit (first run)

cargo audit over 473 crates. zip 4.6.1 carries three advisories (RUSTSEC-2026-0367/0368/0369 — symlink traversal while extracting). They are not reachable here: tauri-plugin-updater calls verify() (minisign, against the pubkey in tauri.conf.json) before install_inner(), so ZipArchive::extract only ever sees a signed archive fetched over HTTPS from this project's own release. Recorded with the reasoning in src-tauri/.cargo/audit.toml, so the decision is reviewable and easy to revisit when the plugin moves to zip >= 9.

npm audit: 0 vulnerabilities. The two remaining Rust warnings (proc-macro-error unmaintained, glib unsound) are build-time-only and Linux-only respectively.

Verified on the release build

  • panel renders identically (same palette)
  • light → dark in 2 ms, dark → light in 1 ms
  • idle working set 148 KB
  • scripts/smoke_test.sh passes end to end
  • 37 unit tests, no compiler warnings, tsc clean, cargo audit clean

Windows Theme Switcher v2.1.2

Choose a tag to compare

@DashAkoul DashAkoul released this 27 Oct 16:38

v2.1.2 — second audit pass

A second review pass, focused on the updater path, lock contention, the IPC surface and CSS. Eight more findings, all fixed. Details in docs/AUDIT.md.

Fixed: a disk write on every theme switch

apply_profile_inner wrote last_active_profile into config.json on every apply — and called config.save() while holding the config mutex, so opening the panel could wait behind a tray click. The field itself was never read anywhere. It is gone (Rust struct, TS types, browser mock) along with the write. Configs from older versions that still contain it keep loading.

Fixed: autostart state could disagree with the registry

toggle_autostart_inner flipped the in-memory value before writing the Run key. If the registry write failed (policy, endpoint protection), the function returned an error but memory already claimed the new value — the mirror of the save_settings bug fixed in 2.1.1. It now reads, writes the registry, and only then updates memory.

Fixed: a click could be silently dropped

If a panel click raced a tray click, the second request returned the live state instead of being applied, so the UI showed the other click's result. apply_profile now waits up to 25 ms and retries once — short on purpose, because the callers run on the main thread.

Security: smaller IPC surface

The hide_panel command was never called from the UI (the ✕ button uses window.close()), and allow-hide / allow-show / allow-set-focus were unused as well — hide/show/set_focus only happen on the Rust side, which needs no JS permission. All four are removed.

CSS and cleanup

  • long error messages are clamped to two lines (the panel is a fixed height with no scrolling)
  • animations respect prefers-reduced-motion
  • dead html[data-theme] rules removed from boot.css (v2 never sets that attribute)
  • stale "340×246" comment corrected, unused ErrorCode variants removed

Verified on the release build

  • panel renders identically (same palette, 324 sampled colours)
  • light → dark → light in 1 ms
  • idle working set 148 KB
  • 37 unit tests pass, no compiler warnings, tsc clean

Windows Theme Switcher v2.1.1

Choose a tag to compare

@DashAkoul DashAkoul released this 26 Oct 12:11

v2.1.1 — audit: bugs, security and cleanup

A full review of the Rust, TypeScript and config files found 12 bugs, 3 security issues and 4 optimisation opportunities. All are fixed. Details: docs/AUDIT.md.

Critical bug: the app could refuse to start

A config.json with valid JSON but invalid values (empty profile name, relative wallpaper path — e.g. after hand-editing) aborted startup, and the only way back was deleting the file manually. Invalid values are now backed up to config.json.invalid and replaced with defaults, exactly like a parse error. Verified on the release build.

Other fixes

  • Autostart drift: only the existence of the Run value was compared, so after the executable moved the key kept pointing at the old path. autostart::sync() now compares the path and rewrites it.
  • Stale tray checkmark for "Start with Windows".
  • save_settings persisted the config before writing the Run key, leaving file and registry disagreeing on failure.
  • hex_to_abgr sliced by byte index: a six-byte non-ASCII string panicked, which with panic=abort killed the app.
  • APPLYING guard, GetMessageW error handling, focus-grace timestamp ordering, monitor-thread startup order, and two flaky parallel tests.

Security

  • Crash triggerable by any local process: wide_ptr_to_string dereferenced the lParam of WM_SETTINGCHANGE without validation. The region is now validated with VirtualQuery before reading.
  • CSP tightened: the production policy still allowed ws://localhost:*, http://localhost:*, asset:, blob: and 'unsafe-inline' (v1 leftovers). It is now minimal (default-src 'self', object-src 'none', frame-ancestors 'none' …) with a separate devCsp; the inline boot <style> moved to public/boot.css. The panel renders identically under the new policy.
  • Log rotation at 256 KB.

Optimisation

Unused windows-crate features, the dead isWindows11 field, dead code/tests and stale comments removed; now_ms() is monotonic.

Verification: 36 unit tests pass (5 new), no compiler warnings, tsc clean, idle working set still 148 KB, theme apply still 1 ms.

Windows Theme Switcher v2.1.0

Choose a tag to compare

@DashAkoul DashAkoul released this 26 Oct 11:30

v2.1.0 — idle footprint in the kilobyte range

A tray app is idle almost all the time, but the resident set kept every page it touched at startup (13.6 MB) and, once the panel had been opened, the WebView2 runtime pages (~45 MB). Windows never hands them back by itself.

The app now calls EmptyWorkingSet at the right moments, which moves those pages to the standby list. Private commit is untouched, so nothing is lost — the pages come back on the next touch.

Measured on the release binary

State Working set (Task Manager) Private commit
Tray only, panel never opened 148 KB (was 13,632 KB) 2.3 MB
Tray, after one panel open/close 148 KB median, max spike 1.9 MB (was ~45 MB) 6.9 MB
Panel open ~49 MB + WebView2 helpers —
  • idle CPU: 0.00 s over 30 s (the janitor reuses the existing wake-event thread, so no extra thread is created)
  • theme apply still 1 ms; panel opens in ~1.0 s
  • zero msedgewebview2.exe processes whenever the panel is closed

How

  • trims after startup, after the panel is destroyed, after it is hidden, and after every tray action
  • a 3 s janitor pass keeps the observed value low even though the WebView2 runtime touches a few MB every ~15 s
  • two-pass trim (trim_settle) because a single call lands around 1 MB instead of the ~200 KB floor
  • strip = true in the release profile

Note on the two numbers: working set is what Task Manager shows and what trimming minimises; commit is the memory actually allocated to the process and does not need to be resident. Both are documented in docs/ARCHITECTURE.md §8.6.

Windows Theme Switcher v2.0.1

Choose a tag to compare

@DashAkoul DashAkoul released this 26 Oct 10:01

v2.0.1 — popup reliability fix

Fixed: the popup could disappear the instant it opened

Windows sends a Focused(false) event right after a window is shown, while it is still becoming foreground. The handler hid the panel immediately, so clicking the tray icon looked like it did nothing. Focus loss within 700 ms of showing the panel is now ignored (and logged).

Fixed: closing with ✕ kept the memory

The ✕ button hid the panel but never armed the idle timer, so the WebView2 footprint (~450 MB) stayed resident. Hiding now schedules the release as well, and a guard prevents piling up timers.

Tighter panel

Height 246 → 232 px: the footer had ~44 px of dead space and still fits a two-line error message.

Verified on the release binary

  • real mouse clicks on the panel switched Windows light → dark → light, apply time 0–2 ms
  • panel opens in ~0.8 s and stays open; logs ignoring early focus loss (26ms after show)
  • idle footprint 13 MB with zero WebView2 processes

Docs: docs/TESTING.md rewritten for v2, docs/ARCHITECTURE.md corrected (CSP location, inline errors, silent update check, no Mica).

Windows Theme Switcher v2.0.0

Choose a tag to compare

@DashAkoul DashAkoul released this 26 Oct 09:39

v2.0.0 — minimal tray popup

The app is a toggle, not an application. The whole UI is now a 340x246 popup instead of a full window.

New UI

  • Light / Dark cards (the active one is highlighted) — one click applies the theme
  • Start with Windows toggle
  • Windows theme settings… link
  • Version footer; an Update to vX link appears only when an update exists
  • Removed: sidebar navigation, onboarding, settings pages, theme editor, live preview, About, language switcher (English only now)

Layout fix

The old window was resizable and its rows wrapped into each other at small sizes. The panel now has a fixed size with no wrapping rows, so text and controls can no longer overlap.

Lighter

  • popup is created on demand, hidden on focus loss, and destroyed after 2 minutes idle — the WebView2 footprint is released (idle app: ~15 MB)
  • dropped the dialog plugin, the Mica/Acrylic path, the language setting and 5 unused settings fields
  • installer 1.92 to 1.86 MiB, frontend bundle 198 to 167 kB
  • old config.json files keep working (removed fields are ignored)

Upgrade

Run the installer or use the in-app updater.

Windows Theme Switcher v1.0.2

Choose a tag to compare

@DashAkoul DashAkoul released this 26 Oct 04:33

v1.0.2 — tray icon fix

Fixed: invisible tray icon in Light mode

The moon icon (shown while Windows is in Light mode) was generated with broken alpha math, so the PNG ended up 100% transparent: Windows reserved the tray slot and the tooltip worked, but nothing was drawn. The sun icon (Dark mode) used a different code path, which is why only Light mode looked broken.

  • fixed the crescent alpha calculation and redrew a bolder moon
  • verified: moon 259 opaque pixels, sun 188 opaque pixels
  • the icon still shows what clicking does: moon (click → Dark) / sun (click → Light)

Upgrade in place: run the installer, or let the built-in updater fetch it.

Windows Theme Switcher v1.0.1

Choose a tag to compare

@DashAkoul DashAkoul released this 26 Oct 03:38

v1.0.1 — performance and stability

Fixed: hangs / "Not Responding"

  • The WM_SETTINGCHANGE broadcast is now fire-and-forget on a worker thread. Broadcasting to every top-level window could stall a theme switch for 25-50 seconds — and because a tray click runs on the UI thread, the whole window froze. Measured: 25s -> 0.43s.
  • Overlapping applies (double-clicking the tray icon) are coalesced into one.

Fixed: memory usage (441 MB -> 15-30 MB when idle)

  • The UI window is created only when you open it and is destroyed when you close it, releasing the entire WebView2 footprint (6 helper processes). The tray keeps running at ~15 MB.
  • The tray menu is rebuilt only when something it displays actually changes.
  • External theme changes are ignored unless the theme really changed.

Fixed: language switching

  • The i18n provider froze the language at its first value, so switching only flipped the text direction. Strings now update immediately (English / فارسی).

Fixed: error spam

  • Typing a partial hex color no longer triggers a backend validation error on every keystroke.
  • A failed registry read no longer breaks the whole UI.
  • Save/Apply disabled while the profile name is empty.

Upgrade in place: run the installer, or let the built-in updater fetch it.

Windows Theme Switcher v1.0.0

Choose a tag to compare

@DashAkoul DashAkoul released this 26 Oct 02:56

Windows Theme Switcher 1.0.0

One-click Light/Dark theme switching from the Windows system tray.

Features

  • Left-click the tray icon to toggle between your Light (Day) and Dark (Night) profiles
  • Smart tray icon: moon while Windows is Light, sun while it is Dark
  • Profiles: Windows Mode, App Mode, Transparency, Accent Color, Wallpaper
  • Theme editor with live preview; "Detect current" imports your current settings
  • Detects theme changes made in Windows Settings (WM_SETTINGCHANGE)
  • Single instance (second launch focuses the running window)
  • Start with Windows (per-user, no admin rights)
  • English + Persian (RTL) UI
  • Auto-update support (signed releases)

Install

Run the NSIS installer. It installs per-user (no administrator required) and starts in the system tray.

License

GNU GPL v3.0 (copyleft) — source: https://github.com/DashAkoul/windows-theme-switcher