From 0a7508c9d2fc506ecd715260b293dcbf1f937703 Mon Sep 17 00:00:00 2001 From: Arnab Chakraborty <11457760+Rocky43007@users.noreply.github.com> Date: Sun, 2 Feb 2025 02:43:54 -0500 Subject: [PATCH] Disable drag on linux --- apps/desktop/src-tauri/src/drag.rs | 8 ++++---- apps/desktop/src/commands.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src-tauri/src/drag.rs b/apps/desktop/src-tauri/src/drag.rs index bff25d3d26da..126b45fa3569 100644 --- a/apps/desktop/src-tauri/src/drag.rs +++ b/apps/desktop/src-tauri/src/drag.rs @@ -77,11 +77,11 @@ pub async fn start_drag( image: String, on_event: Channel, ) -> Result<(), String> { + // If on linux, do not run and throw an error saying that it is not supported for now #[cfg(target_os = "linux")] - let window = window - .gtk_window() - .map_err(|_| "Failed to downcast to ApplicationWindow")?; - + { + return Err("Drag and drop is not supported on Linux yet.".to_string()); + } // Check if image string is base64 encoded let icon_path = if image.starts_with("data:image/") { image diff --git a/apps/desktop/src/commands.ts b/apps/desktop/src/commands.ts index f9e212cb244a..8516120a8af6 100644 --- a/apps/desktop/src/commands.ts +++ b/apps/desktop/src/commands.ts @@ -61,13 +61,13 @@ export const commands = { */ async startDrag( files: string[], - iconPath: string, + image: string, onEvent: TAURI_CHANNEL ): Promise> { try { return { status: 'ok', - data: await TAURI_INVOKE('start_drag', { files, iconPath, onEvent }) + data: await TAURI_INVOKE('start_drag', { files, image, onEvent }) }; } catch (e) { if (e instanceof Error) throw e;