From a8a887e82f02438212051e47276a0939e4c1ca63 Mon Sep 17 00:00:00 2001 From: spark Date: Fri, 23 Oct 2026 17:36:34 +0100 Subject: [PATCH] Remember a dropped folder from the window event, so the contact sheet can open it. The main window delivers the drop as a window event. Recording it only on the webview event left the folder unknown, and opening it was refused. --- apps/desktop/package.json | 2 +- apps/desktop/src-tauri/Cargo.toml | 2 +- apps/desktop/src-tauri/src/lib.rs | 8 ++++++++ apps/desktop/src-tauri/tauri.conf.json | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index b0e9494..9ab393b 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@photoreport/desktop", - "version": "0.3.22", + "version": "0.3.23", "private": true, "type": "module", "scripts": { diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 8045913..4329cf8 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "photoreport-desktop" -version = "0.3.22" +version = "0.3.23" edition = "2024" publish = false description = "PhotoReport desktop: the web app in a native shell, with keychain sign-in and (later) local FTP and the native engine." diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 15d33cd..7373973 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -111,6 +111,14 @@ pub fn run() { .build()?; Ok(()) }) + // The main window is the window's own webview, so a drop arrives as a window event. Noting it only on + // the webview event left the folder unrecorded, and opening it was refused. + .on_window_event(|window, event| { + use tauri::Manager; + if let tauri::WindowEvent::DragDrop(tauri::DragDropEvent::Drop { paths, .. }) = event { + window.state::().note(paths); + } + }) .on_webview_event(|webview, event| { use tauri::Manager; if let tauri::WebviewEvent::DragDrop(tauri::DragDropEvent::Drop { paths, .. }) = event { diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 0104a02..322e183 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PhotoReport", - "version": "0.3.22", + "version": "0.3.23", "identifier": "pt.photoreport.desktop", "build": { "devUrl": "http://localhost:5173", -- 2.47.3