You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing in Windows 10, my backend drop handler never gets run when I drop a file. If I add a console logging line to the drop event in JavaScript however, that does run. So it seems Wails is not propagating the event to the backend properly.
Build for Windows (I am doing so on Arch Linux): wails build -platform windows/amd64 -windowsconsole -debug
Open the .exe in Windows (a Windows 10 VM in my case)
Open the web console using the right-click menu
Drag in a file
Observe how nothing appears in the backend console, but a drop event appears in the web console
Expected behaviour
Backend drop handlers are triggered on Windows 10.
Screenshots
No response
Attempted Fixes
No response
System Details
These are the details of the system I'm building the binary on.
# Wails
Version | v2.9.2
Package Manager | pacman
# System
┌───────────────────────────────────────────────────────────────────────────────────────┐
| OS | Arch Linux || Version | Unknown || ID | arch || Go Version | go1.23.3 || Platform | linux || Architecture | amd64 || CPU | 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz || GPU | TigerLake-LP GT2 [Iris Xe Graphics] (Intel Corporation) - Driver: i915 || Memory | 15GB |
└───────────────────────────────────────────────────────────────────────────────────────┘
# Dependencies
┌─────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status | Version ||*docker | docker | Installed | 1:27.3.1-1 || gcc | gcc | Installed | 14.2.1+r134+gab884fffe3fc-1 || libgtk-3 | gtk3 | Installed | 1:3.24.43-4 || libwebkit | webkit2gtk | Installed | 2.46.4-1 || npm | npm | Installed | 10.9.2-1 || pkg-config | pkgconf | Installed | 2.3.0-1 |
└────────────────────── * - Optional Dependency ──────────────────────┘
# Diagnosis
SUCCESS Your system is ready for Wails development!
Additional context
Seems related to #3782 but I wanted to create a new thread because that one is all over the place.
Unfortunately using the JavaScript handler is not really an option in my case as I would like to open the file directly on the user's system for efficiency and JavaScript doesn't give the full file path.
The text was updated successfully, but these errors were encountered:
I was informed on Discord that setting any sort of JavaScript Wails drop handler would cause the event to propagate to the backend. And indeed this fixed it for me:
// In main.js// Empty callback functionruntime.OnFileDrop(function(x,y,paths){},false);
To me this is unexpected behaviour though, and ideally the backend handler would always be triggered. This would match behaviour on other OSes.
I'm curious as to why Linux needs that. A workaround would be just to execute this on runtime load if the option has been set. I'd accept a PR for that if you're comfortable raising it?
Description
In the backend I have a drop handler registered with
runtime.OnFileDrop
. In the frontend I have this, as per here:When testing in Windows 10, my backend drop handler never gets run when I drop a file. If I add a console logging line to the
drop
event in JavaScript however, that does run. So it seems Wails is not propagating the event to the backend properly.To Reproduce
wails build -platform windows/amd64 -windowsconsole -debug
Expected behaviour
Backend drop handlers are triggered on Windows 10.
Screenshots
No response
Attempted Fixes
No response
System Details
These are the details of the system I'm building the binary on.
Additional context
Seems related to #3782 but I wanted to create a new thread because that one is all over the place.
Unfortunately using the JavaScript handler is not really an option in my case as I would like to open the file directly on the user's system for efficiency and JavaScript doesn't give the full file path.
The text was updated successfully, but these errors were encountered: