|
|
@ -64,8 +64,12 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
|
|
|
|
cbData: bytes.len() as _,
|
|
|
|
cbData: bytes.len() as _,
|
|
|
|
lpData: bytes.as_ptr() as _,
|
|
|
|
lpData: bytes.as_ptr() as _,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
SendMessageW(hwnd, WM_COPYDATA, 0, &cds as *const _ as _);
|
|
|
|
let contains_restart = data.split('|').any(|part| part.trim() == "restart_from_tauri_api\0");
|
|
|
|
app.exit(0);
|
|
|
|
// Single instance mode should not cause restarted applications to exit
|
|
|
|
|
|
|
|
if !contains_restart {
|
|
|
|
|
|
|
|
SendMessageW(hwnd, WM_COPYDATA, 0, &cds as *const _ as _);
|
|
|
|
|
|
|
|
app.exit(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|