@@ -70,18 +70,14 @@ static TRACKING: AtomicBool = AtomicBool::new(false);
70
70
/// * `on_event` - Channel for communicating drag operation events back to the frontend
71
71
#[ tauri:: command( async ) ]
72
72
#[ specta:: specta]
73
+ #[ cfg( not( target_os = "linux" ) ) ]
73
74
pub async fn start_drag (
74
75
window : WebviewWindow ,
75
76
_state : State < ' _ , DragState > ,
76
77
files : Vec < String > ,
77
78
image : String ,
78
79
on_event : Channel < CallbackResult > ,
79
80
) -> Result < ( ) , String > {
80
- // If on linux, do not run and throw an error saying that it is not supported for now
81
- #[ cfg( target_os = "linux" ) ]
82
- {
83
- return Err ( "Drag and drop is not supported on Linux yet." . to_string ( ) ) ;
84
- }
85
81
// Check if image string is base64 encoded
86
82
let icon_path = if image. starts_with ( "data:image/" ) {
87
83
image
@@ -246,6 +242,20 @@ pub async fn start_drag(
246
242
Ok ( ( ) )
247
243
}
248
244
245
+ #[ tauri:: command( async ) ]
246
+ #[ specta:: specta]
247
+ #[ cfg( target_os = "linux" ) ]
248
+ pub async fn start_drag (
249
+ _window : WebviewWindow ,
250
+ _state : State < ' _ , DragState > ,
251
+ _files : Vec < String > ,
252
+ _image : String ,
253
+ _on_event : Channel < CallbackResult > ,
254
+ ) -> Result < ( ) , String > {
255
+ Err ( "Drag and drop is not supported on Linux" . to_string ( ) )
256
+ }
257
+
258
+ /// Stops the cursor position tracking for drag operations
249
259
#[ tauri:: command( async ) ]
250
260
#[ specta:: specta]
251
261
pub async fn stop_drag ( ) {
0 commit comments