Skip to content

macOS: show the window when the Dock icon is clicked - #34

Merged
jondeandres merged 1 commit into
mainfrom
fix-macos-dock-reopen
Nov 16, 2026
Merged

jondeandres merged 1 commit into
mainfrom
fix-macos-dock-reopen

Conversation

@jondeandres

Copy link
Copy Markdown
Contributor

Problem

On macOS, after closing the window (which only hides it, so the app keeps running behind the tray), clicking Nodea in the Dock did nothing. Only the tray's Open Nodea brought it back.

Cause

A Dock click on a running app sends a reopen event, which Tauri delivers as RunEvent::Reopen. The .run closure in src-tauri/src/main.rs only handled RunEvent::Exit, so the hidden window stayed hidden.

Fix

Handle RunEvent::Reopen (macOS only, as the variant is) by showing and focusing the main window, the same as the tray's Open Nodea item.

Testing

  • cargo fmt --check, cargo clippy --all-targets -D warnings and make test-rust pass locally.
  • The event needs a real macOS app run loop, so no automated test covers it. To check by hand: run the app, close the window, click the Dock icon. The window should reappear.

Closing the window only hides it, and the run loop ignored
RunEvent::Reopen, so clicking the Dock icon of the running app did
nothing. Show and focus the main window on Reopen, as the tray's
"Open Nodea" already does.
@jondeandres
jondeandres merged commit b316468 into main Nov 16, 2026
11 checks passed
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