libinput-three-finger-drag icon indicating copy to clipboard operation
libinput-three-finger-drag copied to clipboard

Stopped to work after an upgrade

Open stepanselyuk opened this issue 4 years ago • 10 comments

Hello, this utility stopped working a few months after some upgrade (not sure what I did, first I updated kernel to 5.14.14, and then the system (Ubuntu 21.10) asked about some partial upgrade. After then GNOME40's three fingers gesture somehow returned and I had to use Gnome Shell Hammer extension, but even if it helped with moving 3 to 4 fingers issue, the libinput-three-finger-drag still was not working. I downloaded code, added some verbosity and then I had an issue with compiling because of an issue with libxdo. So I reinstalled packages:

$ sudo apt reinstall xdotool libxdo3 libxdo-dev

after that compilation succeeded and 3-fingers drag (including selection, because this is a general hack with the mouse) worked!

Just writing this here because someone probably will have such an issue and will check this repository.

Three Finger Window Move extension works great, but it's not hacking with a mouse and it really just drag windows from any point inside of it (and prefs.js should be updated to work with GNOME40).

stepanselyuk avatar Oct 26 '21 19:10 stepanselyuk

Actually it stopped working after restarting, and I still cannot find a way how to fix it.

stepanselyuk avatar Oct 26 '21 20:10 stepanselyuk

match action {
                "GESTURE_SWIPE_BEGIN" => {
                    xsum = 0.0;
                    ysum = 0.0;
                    xdo.mouse_down(1).unwrap();
                }
                "GESTURE_SWIPE_UPDATE" => {
                    let x: f32 = parts[6].parse().unwrap();
                    let y: f32 = parts[7].parse().unwrap();
                    xsum += x;
                    ysum += y;
                    println! ("{:?}, {:?}", xsum, ysum);
                    if xsum.abs() > 2.0 || ysum.abs() > 2.0 {
                        xdo.move_mouse_relative(xsum as i32, ysum as i32).unwrap();
                        xsum = 0.0;
                        ysum = 0.0;
                    }
                }
                _ => {
                    xdo.move_mouse_relative(xsum as i32, ysum as i32).unwrap();
                    xdo.mouse_up(1).unwrap();
                }
            }

It's working (text selection) inside of IDE and some windows (but not Terminal). But dragging windows not working at all. Weird thing... like some events or software mixed with each other.

stepanselyuk avatar Oct 26 '21 20:10 stepanselyuk

run libinput debug-events in a terminal and check what events will happen when you select in Terminal or drag a window?

marsqing avatar Oct 27 '21 03:10 marsqing

run libinput debug-events in a terminal and check what events will happen when you select in Terminal or drag a window?

I see normal events,

GESTURE_SWIPE_BEGIN ...
GESTURE_SWIPE_UPDATE ...
...
GESTURE_SWIPE_END ...

stepanselyuk avatar Oct 27 '21 14:10 stepanselyuk

If the events are correct, maybe there's some problem with libxdo.

marsqing avatar Oct 28 '21 02:10 marsqing

Yes, something changed in the kernel. I tried to use 5.14.0 as before and all is working. But with 5.14.14 it is not.

stepanselyuk avatar Oct 28 '21 11:10 stepanselyuk

Was this issue solved ?

rzvn2600 avatar Jul 04 '22 08:07 rzvn2600

Was this issue solved ?

On 5.16 it's working fine :-)

stepanselyuk avatar Jul 04 '22 09:07 stepanselyuk

Thanks a lot @stepanselyuk Btw, I see you are the creator. If I install the 3finger drag, will the "linux" 3 fingers paste still work ?

rzvn2600 avatar Jul 04 '22 09:07 rzvn2600

Thanks a lot @stepanselyuk Btw, I see you are the creator. If I install the 3finger drag, will the "linux" 3 fingers paste still work ?

Yes it works

stepanselyuk avatar Jul 04 '22 10:07 stepanselyuk