Skip to content

fix: new window creation, IPC routing, and native shortcuts - #100

Open
mattdanielmurphy wants to merge 2 commits into
Sidenai:mainfrom
mattdanielmurphy:fix-new-window-actions
Open

fix: new window creation, IPC routing, and native shortcuts#100
mattdanielmurphy wants to merge 2 commits into
Sidenai:mainfrom
mattdanielmurphy:fix-new-window-actions

Conversation

@mattdanielmurphy

Copy link
Copy Markdown

Description

Fixes issues where the "New Window" action failed to correctly spawn OS-level windows in Tauri and prevented newly spawned windows from accessing IPC capabilities.

Changes

  • main.ts: Modified workspaceProvider.open to handle reuse: false correctly by calling Tauri's create_window IPC command natively, instead of merely updating the window location.
  • default.json: Expanded IPC capability windows mask to ["*"] so dynamically spawned windows correctly inherit IPC permissions from the main window.
  • lib.rs:
    • Re-wired native menu dispatcher to route events to the is_focused window instead of hardcoding "main".
    • Updated window_menu to use tauri::menu::WINDOW_SUBMENU_ID to signal to macOS to properly attach native window menu behaviors.
    • Explicitly bound a Cycle Through Windows command to `CmdOrCtrl+`` to preempt aggressive webview event-swallowing, allowing predictable cross-window cycling natively via Rust.

Testing

  • Spawning a "New Window" creates a completely separate Tauri window.
  • Menu actions (like Open File) execute accurately in the actively focused window.
  • Shortcuts like `Cmd+`` effectively cycle between instances natively without frontend interference.

- Update workspaceProvider.open to invoke create_window correctly.
- Add Cmd+` accelerator to intercept window cycling natively.
- Broaden IPC capability windows to '*' so dynamically spawned windows can execute commands.
- Dispatch native menu events to the focused window instead of hardcoding 'main'.
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.

2 participants