Skip to content

Fix macOS window not appearing when switching Spaces#370

Merged
kdroidFilter merged 1 commit intomasterfrom
fix/macos-window-space-switching
Feb 6, 2026
Merged

Fix macOS window not appearing when switching Spaces#370
kdroidFilter merged 1 commit intomasterfrom
fix/macos-window-space-switching

Conversation

@kdroidFilter
Copy link
Owner

@kdroidFilter kdroidFilter commented Feb 6, 2026

Summary

  • Fixes window not appearing when clicking tray icon after switching to a different Space (desktop) on macOS
  • Window now intelligently detects if it has focus before deciding to hide or bring to front
  • When window is on a different Space (unfocused), it's brought to the current Space instead of being hidden

Problem

When the tray window was visible on Space 1 and the user switched to Space 2, clicking the tray icon would attempt to hide the window (because it was marked as "visible") rather than bringing it to the current Space. This resulted in the window not appearing at all when clicking the tray icon from a different Space.

Solution

Before hiding the window on a tray icon click, check if the window has focus:

  • If focused: hide the window (normal toggle behavior)
  • If not focused: bring window to current Space using setMoveToActiveSpace() and toFront()

Test plan

  • Open the tray window on Space 1
  • Switch to Space 2 using Mission Control or keyboard shortcut
  • Click the tray icon from Space 2
  • Window should appear on Space 2 (not hide)
  • Click tray icon again
  • Window should hide normally

When the tray window is visible and the user switches to a different
Space (desktop), clicking the tray icon now brings the window to the
current Space instead of hiding it. This is achieved by checking if
the window has focus before toggling visibility - if unfocused (likely
on another Space), the window is brought to front on the active Space.
@kdroidFilter kdroidFilter merged commit 18eef46 into master Feb 6, 2026
3 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