fix(desktop): always open maximized (not fullscreen) — stop window-state restoring stale geometry (#881)

Co-authored-by: mergetest <test@local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Palash Debnath
2026-07-02 14:03:23 +05:30
committed by GitHub
co-authored by mergetest Claude Fable 5
parent 4eed552153
commit 62035435e8
3 changed files with 56 additions and 2 deletions
+8
View File
@@ -8,6 +8,14 @@ The bundled TTS model package (`pyproject.toml`) is versioned independently.
## [Unreleased]
### Changed
- **The app now always opens maximized (not fullscreen).** Window size and
position are no longer carried over from the previous session — one manual
resize used to make every later launch reopen at that smaller size,
overriding the intended maximized default. Same behavior on macOS
(zoomed window, not a fullscreen Space), Windows, and Linux.
### Fixed
- **Confucius4-TTS is now validated end-to-end — and actually loads.** The
+6 -2
View File
@@ -274,10 +274,14 @@ pub fn run() {
// launch if the user happened to be dictating when they quit,
// overriding the WebviewWindowBuilder `.visible(false)` below.
// Symptom: pill appears on app load with no shortcut press.
// The main window is fine to persist (size/position are useful).
// "main" is denylisted too (owner decision, 2026-07-02): the app
// must ALWAYS open maximized — not fullscreen — per
// tauri.conf.json (`maximized: true`, `fullscreen: false`).
// Persisting geometry meant one manual resize made every later
// launch reopen at that smaller size, overriding the config.
app.handle().plugin(
tauri_plugin_window_state::Builder::default()
.with_denylist(&["widget"])
.with_denylist(&["widget", "main"])
.build(),
)?;
app.handle().plugin(
+42
View File
@@ -0,0 +1,42 @@
"""Launch-window contract (owner decision, 2026-07-02): the app must ALWAYS
open maximized — never fullscreen — on every platform.
Two halves enforce it, and both must hold:
1. tauri.conf.json declares `maximized: true` + `fullscreen: false`.
2. lib.rs denylists BOTH "widget" and "main" in tauri-plugin-window-state —
otherwise restored geometry silently overrides the config, and one manual
resize makes every later launch reopen at that smaller size.
"""
from __future__ import annotations
import json
import re
from pathlib import Path
_ROOT = Path(__file__).resolve().parent.parent
_CONF = _ROOT / "frontend" / "src-tauri" / "tauri.conf.json"
_LIB = _ROOT / "frontend" / "src-tauri" / "src" / "lib.rs"
def _main_window() -> dict:
windows = json.loads(_CONF.read_text())["app"]["windows"]
mains = [w for w in windows if w.get("label", "main") == "main"]
assert len(mains) == 1, f"expected exactly one main window, got {len(mains)}"
return mains[0]
def test_main_window_opens_maximized_not_fullscreen():
win = _main_window()
assert win.get("maximized") is True
assert win.get("fullscreen") is False
def test_window_state_plugin_denylists_main_and_widget():
src = _LIB.read_text()
m = re.search(r"with_denylist\(&\[(?P<labels>[^\]]*)\]\)", src)
assert m, "tauri-plugin-window-state denylist not found in lib.rs"
labels = set(re.findall(r'"([^"]+)"', m.group("labels")))
assert {"main", "widget"} <= labels, (
f"window-state denylist must include main+widget, got {labels}"
"without 'main', restored geometry overrides maximized-on-open"
)