Repository navigation
Linux: serve org.freedesktop.Application and pass launch activation tokens to the shown window - #2216
Merged
Merged
Conversation
opencodejr
Bot
force-pushed
the
bot/issue-22
branch
from
November 25, 2026 09:05
aa15765 to
71fc049
Compare
Member
|
heads up before this gets rebased: #2182 ( also run — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
…okens to the shown window
opencodejr
Bot
force-pushed
the
bot/issue-22
branch
from
November 25, 2026 10:01
71fc049 to
7b04682
Compare
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.
Closes #22.
What changed
open_url/instance/dbus.rs, new; Linux with the defaultdbusfeature): whenrune::single_instance(id)claims its Unix socket, the process also ownsidon the session bus and servesorg.freedesktop.Applicationat/plus the id with dots as slashes and dashes as underscores. It runs on its own thread and connection.rune::release_instancegives the name up, waiting at most 1 s.Activate(a{sv})andActivateAction(s, av, a{sv})reopen the app (App::on_reopen, then the default). Rune has no named actions, so the action's name is not passed on.Open(as, a{sv})sends links toApp::on_open_urland localfile://URIs (percent-decoded, empty orlocalhosthost) toApp::on_open_files.handoff::deliver, so after the loop ends they relaunch the app as socket launches do.XDG_ACTIVATION_TOKENorDESKTOP_STARTUP_IDas--rune-activation-token=.handoff::launchtakes it out of the arguments, so a relaunch doesn't pass it on.activation-token/desktop-startup-id, is kept for 20 s and used once.Host::openuses it when it has no token of its own. A reopen with a token and no window to bring back activates the first visible window.handoff::deliveris shared by the socket and D-Bus paths. A launch with only files doesn't reopen the app.incoming.rs: Linux's files inbox now listens, soon_open_filesreceivesOpenbatches. Windows is unchanged.App::on_reopen,on_open_urlandon_open_files, andsingle_instance, describe the Linux behaviour.<id>.desktopentry and thedbus-1/services/<id>.servicefile.Tests
instance/dbus_tests.rs: object paths,file://decoding, splitting links from files.instance/handoff_tests.rs: the token argument leaves the relaunch arguments; a kept token is used once and lapses; a files-only launch doesn't reopen.cargo test -p rune --lib open_url: 27 passed.cargo clippy -p rune --lib --testsandcargo check -p rune --lib --no-default-features: pass, with no warnings in the touched files.scripts/file-size.sh: no errors.cargo test -p rune --lib(RUNE_ALLOW_NO_GPU=1): 3126 passed, 1 failed. The failure isel::tx::rects::tests::a_handler_reads_a_row_it_removes_where_it_stood, which also fails on the unchanged base.--features rune/test-gpu-noop,window/tests.rsfails to compile (SurfaceMeterandacquirenot found). This change doesn't touch that file.gdbus call --session --dest <id> --object-path /<id path> --method org.freedesktop.Application.Open "['file:///tmp/x']" {}, thenActivate.Closes #22