From 0441c9c78bcf580c567b0830d1ed6c616593be9c Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Tue, 21 Oct 2025 15:14:54 +0200 Subject: [PATCH] Added another handler for window file drop events --- runtime/src/app_window.rs | 9 +++++++++ runtime/tauri.conf.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/runtime/src/app_window.rs b/runtime/src/app_window.rs index a03a3440..57bf80d1 100644 --- a/runtime/src/app_window.rs +++ b/runtime/src/app_window.rs @@ -28,6 +28,15 @@ pub fn start_tauri() { let app = tauri::Builder::default() .setup(move |app| { let window = app.get_window("main").expect("Failed to get main window."); + + // Register a callback for file drop events: + window.on_window_event(|event| + if let tauri::WindowEvent::FileDrop(files) = event { + info!(Source = "Tauri"; "files were dropped: {files:?}"); + } + ); + + // Save the main window for later access: *MAIN_WINDOW.lock().unwrap() = Some(window); info!(Source = "Bootloader Tauri"; "Setup is running."); diff --git a/runtime/tauri.conf.json b/runtime/tauri.conf.json index ed4161f5..e85077b5 100644 --- a/runtime/tauri.conf.json +++ b/runtime/tauri.conf.json @@ -40,7 +40,8 @@ "resizable": true, "title": "MindWork AI Studio", "width": 1920, - "height": 1080 + "height": 1080, + "fileDropEnabled": true } ], "security": {