tauri: [bug] `TauriEvent.DRAG_DROP` don't fire on Arch Linux with Wayland
Describe the bug
When dragging files to Tauri apps on Arch Linux, the Tauri app can fire DRAG_ENTER, DRAG_OVER and DRAG_LEAVE events, but not DRAG_DROP.
Reproduction
-
On Arch Linux, create a Tauri + Vue.js app with
pnpm create tauri-app -
Follow the instructions to install the dependencies
-
Replace the
src/App.vuefile with:<script setup lang="ts"> import { listen, TauriEvent, type Event, type UnlistenFn, } from "@tauri-apps/api/event"; import { onMounted, onUnmounted } from "vue"; let unlistenFns: UnlistenFn[] = []; onMounted(async () => { const logEvent = (e: Event<unknown>) => { console.log(e.event, e.payload); }; unlistenFns = await Promise.all([ listen(TauriEvent.DRAG_ENTER, logEvent), // DRAG_OVER works but produces a lot of events, so we don't log them // listen(TauriEvent.DRAG_OVER, logEvent), listen(TauriEvent.DRAG_LEAVE, logEvent), listen(TauriEvent.DRAG_DROP, logEvent), ]); }); onUnmounted(() => { for (const unlistenFn of unlistenFns) { unlistenFn(); } // clear the array unlistenFns.length = 0; }); </script> <template> <h1>Drag some files here</h1> </template> -
Run the app with
pnpm tauri dev. -
Press Ctrl + Shift + I to open the DevTools window.
-
Drag files to the app window and drop them.
Expected behavior
The app should produce one tauri://drag-enter event and one tauri://drag-drop event for each file.
But no tauri://drag-drop event is fired on my side.
I have also checked with CrabNebula DevTools, only tauri://drag-enter, tauri://drag-over and tauri://drag-leave are fired.
Full tauri info output
> tauri-app@0.1.0 tauri **PROJ_DIR**
> tauri "info"
[✔] Environment
- OS: Arch Linux Rolling Release x86_64 (X64)
✔ webkit2gtk-4.1: 2.46.1
✔ rsvg2: 2.59.1
✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
✔ rustup: 1.27.1 (2024-05-07)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 20.18.0
- pnpm: 9.12.1
- npm: 10.9.0
- bun: 1.1.30
[-] Packages
- tauri 🦀: 2.0.2
- tauri-build 🦀: 2.0.1
- wry 🦀: 0.44.1
- tao 🦀: 0.30.3
- @tauri-apps/api : 2.0.2
- @tauri-apps/cli : 2.0.2
[-] Plugins
- tauri-plugin-shell 🦀: 2.0.1
- @tauri-apps/plugin-shell : 2.0.0
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: Vue.js
- bundler: Vite
Stack trace
No response
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19 (5 by maintainers)
Commits related to this issue
- fix(linux): fix `DragDrop` never fired on wayland closes tauri-apps/tauri#11282 — committed to tauri-apps/wry by amrbashir 2 years ago
- fix(linux): fix `DragDropEvent::Drop` never fired on wayland (#1408) * fix(linux): fix `DragDrop` never fired on wayland closes tauri-apps/tauri#11282 * Update src/webkitgtk/drag_drop.rs — committed to tauri-apps/wry by amrbashir 2 years ago
@amrbashir you patch works for me to, Thanks!
I’m using Gnome 47.0 on Ubuntu 24.10. X.Org 21.1.13
Code is here: https://github.com/metdxt/tauri_dnd_issue
The solution by amrbashir works on my side too. Thank you.
Works on my side. Thank you for your work!