Fixed Windows build for native plugin sharing

This commit is contained in:
Thorsten Sommer 2026-08-06 11:14:01 +02:00
parent 8a9e6aeb87
commit 9928e37cb0
No known key found for this signature in database
GPG Key ID: B0B7E2FC074BF1F5

View File

@ -96,7 +96,7 @@ async fn share_file_on_platform(_path: PathBuf) -> Result<(), String> {
async fn share_file_on_platform(path: PathBuf) -> Result<(), String> {
use std::cell::RefCell;
use windows::ApplicationModel::DataTransfer::{DataRequestedEventArgs, DataTransferManager};
use windows::Foundation::{EventRegistrationToken, TypedEventHandler};
use windows::Foundation::TypedEventHandler;
use windows::Storage::{IStorageItem, StorageFile};
use windows::Win32::UI::Shell::IDataTransferManagerInterop;
use windows::core::{factory, HSTRING, Interface};
@ -108,7 +108,7 @@ async fn share_file_on_platform(path: PathBuf) -> Result<(), String> {
// and remove the previous handler before adding a new one. We only ever register on the main
// thread, hence a thread-local reference is sufficient:
thread_local! {
static DATA_REQUESTED_TOKEN: RefCell<Option<EventRegistrationToken>> = const { RefCell::new(None) };
static DATA_REQUESTED_TOKEN: RefCell<Option<i64>> = const { RefCell::new(None) };
}
let window = crate::app_window::MAIN_WINDOW.lock().unwrap().clone()