Skip to content

Commit 35aa52f

Browse files
committed
fix(single-instance): dbus_path should start with /, can't include -
1 parent bbc1771 commit 35aa52f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • plugins/single-instance/src/platform_impl

plugins/single-instance/src/platform_impl/linux.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ pub fn init<R: Runtime>(
3535
plugin::Builder::new("single-instance")
3636
.setup(move |app, _api| {
3737
let mut dbus_name = dbus_id.unwrap_or_else(|| app.config().identifier.clone());
38-
dbus_name.push_str(".SingleInstance");
3938

4039
#[cfg(feature = "semver")]
4140
{
4241
dbus_name.push('_');
4342
dbus_name.push_str(semver_compat_string(&app.package_info().version).as_str());
4443
}
44+
dbus_name.push_str(".SingleInstance");
4545

46-
let dbus_path = dbus_name.replace('.', "/");
46+
let mut dbus_path = dbus_name.replace('.', "/").replace('-', "_");
47+
if !dbus_path.starts_with('/') {
48+
dbus_path = format!("/{dbus_path}");
49+
}
4750

4851
let single_instance_dbus = SingleInstanceDBus {
4952
callback,

0 commit comments

Comments
 (0)