mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-27 11:56:05 +02:00
Merge remote-tracking branch 'origin/v1' into chore/merge-v1-into-v2
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
|
||||
#![cfg(target_os = "windows")]
|
||||
|
||||
#[cfg(feature = "semver")]
|
||||
use crate::semver_compat::semver_compat_string;
|
||||
|
||||
use crate::SingleInstanceCallback;
|
||||
use std::ffi::CStr;
|
||||
use tauri::{
|
||||
@@ -33,7 +36,13 @@ const WMCOPYDATA_SINGLE_INSTANCE_DATA: usize = 1542;
|
||||
pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
|
||||
plugin::Builder::new("single-instance")
|
||||
.setup(|app, _api| {
|
||||
let id = &app.config().identifier;
|
||||
#[allow(unused_mut)]
|
||||
let mut id = app.config().identifier.clone();
|
||||
#[cfg(feature = "semver")]
|
||||
{
|
||||
id.push('_');
|
||||
id.push_str(semver_compat_string(app.package_info().version.clone()).as_str());
|
||||
}
|
||||
|
||||
let class_name = encode_wide(format!("{id}-sic"));
|
||||
let window_name = encode_wide(format!("{id}-siw"));
|
||||
|
||||
Reference in New Issue
Block a user