Skip to content

Fix/macos on main#2

Open
Nifalu wants to merge 6 commits into
mainfrom
fix/macos-on-main
Open

Fix/macos on main#2
Nifalu wants to merge 6 commits into
mainfrom
fix/macos-on-main

Conversation

@Nifalu

@Nifalu Nifalu commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Fix macOS: main has been crashing on connect since the refactor

Main's codebase/ + frontends/ reorg landed before 5 macOS fix commits from unified-ui were ported. This PR brings them forward into the new layout and fixes three concrete bugs that went with the refactor.

Changes:

  • codebase/ui/src/vpn_ui/main.py — defer tray/notifications to a _startup() fired after exec(). Instantiating QSystemTrayIcon before the event loop crashes macOS when launched from Finder.
  • codebase/ui/src/vpn_ui/tray.py — programmatic 22×22 template icons on macOS so the menu bar renders correctly in light/dark mode. Linux path unchanged.
  • codebase/core/auth.py — only set PLAYWRIGHT_BROWSERS_PATH when unset, so the packaged .app can point at bundled browsers.
  • frontends/osx/daemon/vpn_daemon.py — drop dead from ui.macos.daemon.protocol import … block (path didn't exist; flag never read).
  • frontends/osx/scripts/build-macos.sh — cp the real daemon instead of a drifted inline heredoc; add a component plist with - BundleIsRelocatable=false so the pkg always installs to /Applications/.
    frontends/osx/build.sh — open the built pkg at the end.

Nifalu added 5 commits April 21, 2026 10:17
The codebase/ + frontends/ refactor landed before the macOS fixes from
unified-ui, breaking macOS on main. Bring them into the new layout:

- main.py: defer tray/notifications to after exec() (crash on Finder launch)
- tray.py: programmatic template icons for macOS menu bar
- auth.py: respect pre-set PLAYWRIGHT_BROWSERS_PATH (bundled browsers)
- vpn_daemon.py: drop dead protocol-import block
- build-macos.sh: cp the daemon instead of an embedded, drifted heredoc
Installer's bundle-relocation feature can redirect the install into any
other copy of the bundle LaunchServices finds on disk (e.g. a stale dev
build). Pin the install path via a component plist with
BundleIsRelocatable=false.
The build script installs Chromium into Contents/Resources/browsers/
but nothing set PLAYWRIGHT_BROWSERS_PATH at runtime, so Playwright
fell back to ~/.cache/ms-playwright and tried to download a fresh
browser — failing on fresh Macs. Detect the PyInstaller bundle in
__main__ and wire the env var before vpn_ui imports run.
@Nifalu

Nifalu commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

@blacksheeep kannst du testen ob auf linux noch alles so läuft wie es sollte?

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.

1 participant