Skip to content

Commit

Permalink
allow replacing orphaned dbus servers
Browse files Browse the repository at this point in the history
This works around the issue, where dbus servers would stay around until
the application ends, although their corresponding session had already
ended. New sessions were then unable to communicate through dbus. Now,
newer servers will just replace any previous name owners.
  • Loading branch information
eladyn committed May 7, 2022
1 parent de5c92e commit 89fa16d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dbus_mpris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ async fn create_dbus_server(
panic!("Lost connection to D-Bus: {}", err);
});

conn.request_name("org.mpris.MediaPlayer2.spotifyd", false, true, true)
// TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions
// later. We should instead properly release the name when the session ends.
conn.request_name("org.mpris.MediaPlayer2.spotifyd", true, true, true)
.await
.expect("Failed to register dbus player name");

Expand Down

0 comments on commit 89fa16d

Please sign in to comment.