marsqing / libinput-three-finger-drag

Three-finger-drag support for libinput
MIT License
87 stars 11 forks source link

Stopped to work after an upgrade #4

Open stepanselyuk opened 2 years ago

stepanselyuk commented 2 years ago

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 commented 2 years ago

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

stepanselyuk commented 2 years ago
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.

marsqing commented 2 years ago

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

stepanselyuk commented 2 years ago

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 ...
marsqing commented 2 years ago

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

stepanselyuk commented 2 years ago

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.

rzvn2600 commented 1 year ago

Was this issue solved ?

stepanselyuk commented 1 year ago

Was this issue solved ?

On 5.16 it's working fine :-)

rzvn2600 commented 1 year ago

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 ?

stepanselyuk commented 1 year ago

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