rkevin-arch / CLIdrag

Command line tool to drag files into GUI applications
13 stars 0 forks source link

Does not work for me #1

Open Ashark opened 1 year ago

Ashark commented 1 year ago

I cannot make it work. Installed clidrag from aur: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=clidrag - it uses c++ version. When I call the command, nothing happens, it just silently exitted (next terminal prompt is printed). No any error messages. Also tried to launch the python version (installed pyqt5 with pip), and the same result, nothing happens. I am in KDE Plasma, wayland session. What I am doing wrong?

vimpostor commented 10 months ago

wayland session

There you already have the problem. This only works on X11 and I am not sure if this kind of usability is even possible to implement on Wayland.

It might as well be a bug in Qt (I had a brief look at the source code, but there was nothing obvious), but I wouldn't be surprised if this is yet another workflow that is unsupported on Wayland unless you manage to write another workaround API spec for this niche usecase.

Edit: I looked more into this and am now pretty sure that Wayland does not support such features: According to the spec wl_data_device::start_drag() requires the serial number of an implicit grab and an implicit grab involves either a mouse pressed or a touchpad pressed etc...

For reference here is the source code of KWin, where it obliges to the spec and aborts the drag if no button is pressed: https://invent.kde.org/plasma/kwin/-/blob/754b549f01b1adee727aa8e155e08cda8af91f44/src/wayland/datadevice.cpp#L99

BTW if you start the program in XWayland mode instead of native Wayland mode, then it will kinda work, but only as long as you drop into other XWayland applications. For native Wayland mode, it will probably never work.