Skip to content

Commit 5faaaed

Browse files
committed
feat: add get_process_id tauri api
1 parent de9b3a4 commit 5faaaed

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ fn _get_window_labels(app: tauri::AppHandle) -> Vec<String> {
8282
.collect()
8383
}
8484

85+
#[tauri::command]
86+
fn get_process_id() -> u32 {
87+
std::process::id()
88+
}
8589

8690
#[tauri::command]
8791
fn _get_clipboard_files() -> Option<Vec<String>> {
@@ -336,7 +340,7 @@ fn main() {
336340
}))
337341
.on_window_event(|event| process_window_event(&event))
338342
.invoke_handler(tauri::generate_handler![
339-
get_mac_deep_link_requests,
343+
get_mac_deep_link_requests, get_process_id,
340344
toggle_devtools, console_log, console_error, _get_commandline_args, get_current_working_dir,
341345
_get_window_labels,
342346
put_item, get_item, get_all_items, delete_item,

0 commit comments

Comments
 (0)