Menu ▾ ▴

#29 Clicking the Dock icon should reopen the main window when none is visible (macOS)

closed
nobody
2026-07-01
2026-06-30
Anonymous
No

Originally created by: kristofferR

Problem

On macOS, clicking the Dock icon (or choosing the app in the App Switcher) when no Carrier window is visible does nothing. This happens after the main window is closed-to-tray (hide_on_close) or otherwise hidden — the only way back to the window is the tray menu, which is non-obvious. Standard macOS behavior is that activating an already-running app reopens its main window if none is open.

Expected

Clicking the Dock icon with no visible window should re-show (or recreate) the main Carrier window and bring it to the front. Reference: IPTVchecker does exactly this.

Cause

src-tauri/src/lib.rs handles RunEvent::Ready and RunEvent::ExitRequested in the run loop (~lib.rs:1855), but there is no RunEvent::Reopen handler. On macOS, Tauri emits RunEvent::Reopen { has_visible_windows, .. } when the Dock icon is clicked; without handling it, the click is a no-op.

The close path (install_main_close_handler, lib.rs:1116) hides the main window to the tray rather than destroying it, so the typical fix is: on Reopen with !has_visible_windows, show() + set_focus() the existing main window (recreate it if it's genuinely gone, e.g. after a theme switch).

Notes

  • macOS-only event; Windows/Linux reactivation goes through the taskbar/tray and isn't affected.
  • Keep it consistent with the tray "show window" action so both paths reuse the same reveal logic.

Related

Tickets: #36
Tickets: #39

Discussion

  • Anonymous

    Anonymous - 2026-07-01

    Originally posted by: kristofferR

    Merged PR [#39] to main in 317a629. The macOS Dock reopen behavior is covered with regression tests for hidden/no-window and settings-only activation cases, so closing this as resolved.

     

    Related

    Tickets: #39

  • Anonymous

    Anonymous - 2026-07-01

    Ticket changed by: kristofferR

    • status: open --> closed
     

Log in to post a comment.