Added another handler for window file drop events

This commit is contained in:
Thorsten Sommer 2025-10-21 15:14:54 +02:00
parent ce302e7b98
commit 0441c9c78b
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 11 additions and 1 deletions

View File

@ -28,6 +28,15 @@ pub fn start_tauri() {
let app = tauri::Builder::default() let app = tauri::Builder::default()
.setup(move |app| { .setup(move |app| {
let window = app.get_window("main").expect("Failed to get main window."); 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); *MAIN_WINDOW.lock().unwrap() = Some(window);
info!(Source = "Bootloader Tauri"; "Setup is running."); info!(Source = "Bootloader Tauri"; "Setup is running.");

View File

@ -40,7 +40,8 @@
"resizable": true, "resizable": true,
"title": "MindWork AI Studio", "title": "MindWork AI Studio",
"width": 1920, "width": 1920,
"height": 1080 "height": 1080,
"fileDropEnabled": true
} }
], ],
"security": { "security": {