diff --git a/CHANGELOG.md b/CHANGELOG.md index a3145230..f87fb586 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ ## [Unreleased] +## [0.0.10] - 2026-10-03 + +### Fixed + +- Wait for the Wails UI thread to make a tray-hidden window visible during single-instance handoff, preventing a desktop shortcut launch from showing an error while the existing FreeOS window is still being restored. + ## [0.0.9] - 2026-10-02 ### Fixed diff --git a/desktop/src/instance_windows.go b/desktop/src/instance_windows.go index 908574b4..b9e97ef2 100644 --- a/desktop/src/instance_windows.go +++ b/desktop/src/instance_windows.go @@ -8,6 +8,7 @@ import ( "path/filepath" "strings" "syscall" + "time" "unsafe" "golang.org/x/sys/windows" @@ -56,8 +57,20 @@ func activateExistingInstance() bool { } else { _, _, _ = procShowWindow.Call(hwnd, swShow) } - visible, _, _ := procIsVisible.Call(hwnd) - if visible == 0 { + visible := false + for range 20 { + current, _, _ := procIsVisible.Call(hwnd) + if current != 0 { + visible = true + break + } + // Wails applies Hide/Show on its UI thread. Reissue the request while + // waiting so a delayed hide event cannot win the single-instance handoff. + _, _, _ = procShowWindow.Call(hwnd, swRestore) + _, _, _ = procShowWindow.Call(hwnd, swShow) + time.Sleep(50 * time.Millisecond) + } + if !visible { log.Printf("FreeOS window could not be restored") return false } diff --git a/pyproject.toml b/pyproject.toml index 06bc2cbd..63fae65b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "octop" -version = "0.0.9" +version = "0.0.10" description = "FreeOS — self-hosted multi-user multi-agent assistant with an optional organization OS module (Octop-compatible package name)" readme = "README.md" license = { text = "MIT" } diff --git a/src/octop/__init__.py b/src/octop/__init__.py index a9f39bcc..307eb09e 100644 --- a/src/octop/__init__.py +++ b/src/octop/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -__version__ = "0.0.9" +__version__ = "0.0.10" diff --git a/uv.lock b/uv.lock index 6d59143c..75ee7d32 100644 --- a/uv.lock +++ b/uv.lock @@ -2503,7 +2503,7 @@ wheels = [ [[package]] name = "octop" -version = "0.0.9" +version = "0.0.10" source = { editable = "." } dependencies = [ { name = "acme" },