Skip to content

feat(windows): minimise PWDTT to tray - #33

Merged
luminescq merged 1 commit into
luminescq:mainfrom
mrddt-tech:feat/windows-minimise-to-tray
Oct 5, 2026
Merged

luminescq merged 1 commit into
luminescq:mainfrom
mrddt-tech:feat/windows-minimise-to-tray

Conversation

@mrddt-tech

Copy link
Copy Markdown
Contributor

Problem

On Windows, minimising PWDTT left it in the taskbar and offered no tray controls.

Root cause

Wails v2 exposes the minimized state but no public minimize callback on Windows.

Implementation

  • Add a Windows-only notification-area icon with Show and Exit actions.
  • Hide the Wails window after it enters the minimized state.
  • Restore an existing instance when a second instance launches.
  • Wait briefly for the tray shutdown callback so Windows can remove the icon cleanly.

Tests

  • go test ./...
  • cd frontend && npm test -- --run
  • GOOS=windows GOARCH=amd64 go test .
  • Windows production build

Observed behavior

Manually tested on Windows 10: minimize hides the taskbar entry, tray click/menu restores the window, and Exit removes the tray icon.

Trade-offs

The minimized-state check polls every 200 ms. Wails v2 has no narrow supported earlier callback; avoiding a Win32 hook or Wails fork keeps the implementation contained.

@mrddt-tech
mrddt-tech marked this pull request as ready for review September 7, 2026 13:32
@luminescq
luminescq merged commit 7b8ebe4 into luminescq:main Oct 5, 2026
@mrddt-tech

Copy link
Copy Markdown
Contributor Author

Недавно заметил небольшой баг этой фичи: иногда иконка в трее перестаёт отвечать - не реагирует на левые/правые клики мыши. Но на работу приложения это никак не влияет. Чтобы увидеть окно запущенной программы нужно просто ещё раз запустить экзешник - это показывает (восстанавливает) окно программы. Пока не знаю из-за чего это происходит.

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.

2 participants