Skip to content

fix(macos): preserve capsule visibility in fullscreen spaces#642

Closed
XinShuichen wants to merge 1 commit into
Open-Less:betafrom
XinShuichen:codex/pr-macos-capsule-only
Closed

fix(macos): preserve capsule visibility in fullscreen spaces#642
XinShuichen wants to merge 1 commit into
Open-Less:betafrom
XinShuichen:codex/pr-macos-capsule-only

Conversation

@XinShuichen

@XinShuichen XinShuichen commented Jun 10, 2026

Copy link
Copy Markdown

User description

Summary

  • follow up the existing macOS Spaces/fullscreen capsule fixes by keeping the capsule window in its overlay configuration after startup and after hide
  • replace macOS window.hide() on the capsule path with an AppKit orderOut helper so the window does not get rebound to a regular Space
  • harden the static macOS capsule contract test around the new overlay behavior

Why the current implementation still breaks

Previous fixes in #549 and #556 taught the capsule how to join all Spaces and fullscreen Spaces at show time. That helps for the first show, but the Tauri window still goes through the regular hide() path:

  • startup hides the capsule with window.hide()
  • idle/hidden transitions also call window.hide()

On macOS, that means the next show is starting from a normal hidden NSWindow state again, so the overlay can still fall back to the app's own desktop Space instead of the current fullscreen Space.

This patch keeps the existing webview capsule, but treats its NSWindow more like a non-activating HUD overlay:

  • clear MoveToActiveSpace and Stationary
  • keep CanJoinAllSpaces + FullScreenAuxiliary
  • add Transient, IgnoresCycle, and the non-activating panel style bit
  • hide with orderOut instead of the regular Tauri hide() path

Verification

  • npm --prefix "openless-all/app" run check:macos-capsule-spaces
  • git diff --check

Notes

  • I could not run cargo test in this fork clone because the checkout is missing the vendor/qwen-asr C sources required by build.rs.
  • The behavior itself was smoke-tested separately on a local macOS build while narrowing this patch down from a larger self-use branch.

PR Type

Bug fix, Tests


Description

  • Overlay capsule on fullscreen macOS Spaces

  • Configure NSWindow with proper collection behavior, style mask, and window level

  • Hide capsule with orderOut instead of window.hide() to keep space association

  • Add unit tests and update contract test for new helpers


Diagram Walkthrough

flowchart LR
  A["show_capsule_window_no_activate"] --> B["configure_macos_capsule_window_for_overlay"]
  B --> C["setCAN_JOIN_ALL_SPACES, TRANSIENT, IGNORES_CYCLE, FULL_SCREEN_AUXILIARY"]
  B --> D["setNONACTIVATING_PANEL"]
  B --> E["setAssistiveTechHigh level"]
  B --> F["orderFrontRegardless"]
  G["hide_capsule_window_preserving_space"] --> H["configure_macos_capsule_window_for_overlay"]
  H --> I["orderOut"]
Loading

File Walkthrough

Relevant files
Enhancement
coordinator.rs
Refactor macOS capsule overlay configuration and hide       

openless-all/app/src-tauri/src/coordinator.rs

  • Added helper functions for macOS capsule overlay configuration:
    macos_capsule_collection_behavior, macos_capsule_style_mask,
    macos_capsule_window_level
  • Refactored show_capsule_window_no_activate to apply overlay settings
    before orderFrontRegardless
  • Added prepare_capsule_window_for_overlay and
    hide_capsule_window_preserving_space functions
  • Added unit tests for collection behavior and style mask
+152/-18
lib.rs
Use overlay-preserving hide on macOS startup                         

openless-all/app/src-tauri/src/lib.rs

  • On macOS startup, use prepare_capsule_window_for_overlay and
    hide_capsule_window_preserving_space instead of capsule.hide()
+9/-1     
Tests
macos-capsule-spaces-contract.test.mjs
Update contract test for new overlay helpers                         

openless-all/app/scripts/macos-capsule-spaces-contract.test.mjs

  • Updated assertions for new helpers: behavior helper, style helper,
    hide helper
  • Removed check for window.show() from forbidden list
  • Added check for orderOut in hide helper
+49/-6   

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

556 - Partially compliant

Compliant requirements:

  • FullScreenAuxiliary added via macos_capsule_collection_behavior function.
  • CanJoinAllSpaces and orderFrontRegardless are kept in the show path.
  • Contract test extended to cover fullscreen auxiliary behavior (assertMatch for FULL_SCREEN_AUXILIARY).

Non-compliant requirements:

(empty)

Requires further human verification:

(empty)

549 - Partially compliant

Compliant requirements:

  • Capsule joins all Spaces via collection behavior (CanJoinAllSpaces in macos_capsule_collection_behavior).
  • No-activation display behavior preserved (orderFrontRegardless used, forbidden calls list updated).
  • Static contract test added and covers these behaviors.

Non-compliant requirements:

(empty)

Requires further human verification:

(empty)

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@XinShuichen XinShuichen marked this pull request as draft June 11, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant