Fix Windows file handoff when single-instance mode is enabled #164

Open
opened 2026-04-05 16:18:44 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @kisslorand on 3/25/2026

The issue

On Windows, when single-instance mode is enabled, opening a file from outside OrcaSlicer (for example by double-clicking an .stl, .3mf, exporting STL from Fusion, Printables, Thingiverse, etc.) should send that file to the already-running instance.

Instead, the second launch is blocked, and the file is not opened at all.

What causes it

The forwarding logic looked for the already-running OrcaSlicer window using its native title text.

A recent titlebar change (PR #12706) made the window title contain only the project name instead of including OrcaSlicer, so the running instance could no longer be found this way.

The second process still detects that another instance exists, so it exits, but the file-open request is never handed off.

The fix in this PR

Stop relying on title text to find the running instance.

Instead, identify the existing main window using stable window properties and the instance hash already used for version matching.

This makes the handoff logic independent of how the titlebar is formatted and restores correct forwarding of files opened from Explorer or other external sources.

Result

With single-instance mode enabled on Windows:

  • opening a model file while OrcaSlicer is already running forwards it to the existing instance
  • the launched file is no longer dropped
  • the behavior no longer depends on the current window title

Fixes #12925

*Originally created by @kisslorand on 3/25/2026* ## The issue On Windows, when single-instance mode is enabled, opening a file from outside OrcaSlicer (for example by double-clicking an `.stl`, `.3mf`, exporting STL from Fusion, Printables, Thingiverse, etc.) should send that file to the already-running instance. Instead, the second launch is blocked, and the file is not opened at all. ## What causes it The forwarding logic looked for the already-running OrcaSlicer window using its native title text. A recent titlebar change (PR #12706) made the window title contain only the project name instead of including `OrcaSlicer`, so the running instance could no longer be found this way. The second process still detects that another instance exists, so it exits, but the file-open request is never handed off. ## The fix in this PR Stop relying on title text to find the running instance. Instead, identify the existing main window using stable window properties and the instance hash already used for version matching. This makes the handoff logic independent of how the titlebar is formatted and restores correct forwarding of files opened from Explorer or other external sources. ## Result With single-instance mode enabled on Windows: - opening a model file while OrcaSlicer is already running forwards it to the existing instance - the launched file is no longer dropped - the behavior no longer depends on the current window title Fixes #12925
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#164