Skip to content

Multiple dock icons created with multiple monitors #1844

Closed

Description

@jakeleventhal

Description

I open the screen record window, then select window, and then 3 doc icons appear
Image

Reproduction

Described above

Additional Context

  • Cap version: 0.4.84
  • Operating system, version: macOS 26.5 (25F71)
  • Device (optional): MacBook Pro 16-inch, 2021

cap-desktop.log.2026-05-19.zip

Activity

  1. added
    bug
    on May 19, 2026
  2. linear commented on May 19, 2026

    @linear
  3. tembo commented on May 19, 2026

    @tembo

    Looking at this, the issue is related to how the target select overlay creates separate windows for each monitor. In apps/desktop/src-tauri/src/target_select_overlay.rs:55-81, when you open the target select (window selection mode), the code enumerates all connected displays and creates a TargetSelectOverlay window for each one:

    let display_ids = if let Some(display_id) = resolved_specific_display_id.clone() {
        vec![display_id]
    } else if let Some(display) = focused_target.as_ref().and_then(|t| t.display()) {
        vec![display.id()]
    } else {
        let displays = Display::list();
        if displays.is_empty() {
            vec![Display::primary().id()]
        } else {
            displays.into_iter().map(|display| display.id()).collect()
        }
    };

    Each overlay window then triggers dock visibility sync in apps/desktop/src-tauri/src/windows.rs:1621 via schedule_macos_dock_visibility_sync(), which was added in #1777 to debounce dock visibility updates. However, since TargetSelectOverlay isn't included in the activates_dock() check at windows.rs:826-837, these windows shouldn't be activating the dock at all.

    Worth noting issue #1843 was also reported today about "Always show dock icon not working" - both issues may share a root cause in how the dock visibility state is being managed. The relevant dock visibility logic is in apps/desktop/src-tauri/src/permissions.rs:152-170 (sync_macos_dock_visibility).

    If you're investigating this, focus on:

    • permissions.rs:145-149 - prepare_macos_panel_window sets activation policy to Accessory before creating overlay windows
    • permissions.rs:152-170 - sync_macos_dock_visibility determines whether to show/hide the dock icon
    • windows.rs:826-837 - activates_dock() defines which window types should show the dock icon
  4. richiemcilroy commented on Aug 2, 2026

    @richiemcilroy
    Member

    We fixed the app spawning duplicate dock icons across multiple monitors (c00cefa, #1849). This should be in the latest release, please reopen if you still see duplicates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions