Repository navigation
feat: open files from later launches in the running Leafdown - #690
Merged
Merged
Conversation
The single-instance plugin stays on 2.4.5: 2.5 requires Tauri 2.12, which is a separate upgrade. 2.4.5 already hands the running process the right to take the foreground, but its second instance panics on an argument that is not valid Unicode, which 2.5.3 fixes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Each operating-system open started its own Leafdown process. Those processes could not see each other's open documents, and whichever exited last wrote its settings and recent items over the other's. A launch while Leafdown runs now hands its arguments and working directory to the running process and exits without showing a window. The first launch behaves as before.
tauri-plugin-single-instanceis registered before every other plugin, so a second launch exits before any other plugin starts. A relative path resolves against the second launch's working directory.tauri dev) leave the plugin out. They share the installed application's identifier, which names the instance the plugin looks for, so a dev run would otherwise hand off to an installed Leafdown and exit. The desktop E2E build is atauri build --debugbuild and routes as release builds do.Related Issue
Closes #643
Refs #639
Verification
launchtests: a forwarded relative path resolves against the launch's working directory rather than the process's, and absolute, missing, and unsupported paths are kept for Open File to report. A launch without a path queues nothing but still brings its window forward, and each window's queue is taken once, in arrival order.windowandwindow_documentstests: focus order puts the most recently focused window first and forgets destroyed windows, and the registry finds the window holding a path under any spelling, including a pending claim.openSession,launchDocumentApi, andapptests:pnpm checkpassed.Manually verified in a debug build under a separate application identifier on Windows 11, driven over the WebView2 DevTools protocol:
Not verified:
launch-documentdesktop scenario, which CI runs;Notes