diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index fea395e..f724af9 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -5,14 +5,16 @@ Completed work is recorded in [CHANGELOG.md](CHANGELOG.md), not here. ## Open Items -### Window size — skip saving when maximized +### Window size persistence *(frozen)* -When the window is closed or the app quits while maximized, the maximized -dimensions are persisted and the window opens at that size on the next launch. -The fix requires detecting the window's maximized state via the native OS API -(`IsZoomed` on Windows, `_NET_WM_STATE` on X11/Linux, `NSWindow.isZoomed` on -macOS). A platform-specific implementation per OS is needed; a cross-platform -Fyne API for this does not exist in v2.x. +Window size is currently **not** saved on quit or close. Saving was disabled +because `w.Canvas().Size()` returns the maximized dimensions when the window is +maximized, which would corrupt the stored size on the next launch. + +Re-enabling requires a cross-platform way to detect the maximized state before +saving. Fyne v2.x has no API for this; it needs per-OS native calls: +`IsZoomed` (Windows), `_NET_WM_STATE` (X11/Linux), `NSWindow.isZoomed` +(macOS). Unfreeze once that detection is in place. ### History tab — column filters (Trigger / Job / State) diff --git a/src/ui/tray.go b/src/ui/tray.go index dd877bd..631e4ad 100644 --- a/src/ui/tray.go +++ b/src/ui/tray.go @@ -33,14 +33,22 @@ func configureSystemTray(a fyne.App, w fyne.Window) { // Russian system) because it only recognizes an existing quit by matching the // localized label — which our literal "Quit" does not. Setting IsQuit makes // Fyne reuse this item instead of adding a duplicate, regardless of locale. - saveWindowSize := func() { - size := w.Canvas().Size() - prefs := a.Preferences() - prefs.SetFloat("window.width", float64(size.Width)) - prefs.SetFloat("window.height", float64(size.Height)) - } + + // Window size persistence is frozen: w.Canvas().Size() returns the maximized + // dimensions when the window is maximized, so saving here would corrupt the + // stored size. Needs cross-platform maximized-state detection (IsZoomed / + // _NET_WM_STATE / NSWindow.isZoomed) before it can be re-enabled safely. + // See ROADMAP.md — "Window size — skip saving when maximized". + // + // saveWindowSize := func() { + // size := w.Canvas().Size() + // prefs := a.Preferences() + // prefs.SetFloat("window.width", float64(size.Width)) + // prefs.SetFloat("window.height", float64(size.Height)) + // } + quit := fyne.NewMenuItem("Quit", func() { - saveWindowSize() + // saveWindowSize() a.Quit() }) quit.IsQuit = true @@ -58,7 +66,7 @@ func configureSystemTray(a fyne.App, w fyne.Window) { // Closing hides the window instead of quitting because scheduler tools are // expected to keep working in the background. The explicit Quit tray item // remains the way to stop the process. - saveWindowSize() + // saveWindowSize() w.Hide() }) }