horriblename / hyprgrass

hyprland plugin for touch gestures
BSD 3-Clause "New" or "Revised" License
225 stars 7 forks source link

Misaligned mouse gestures #121

Closed ForgotMyPasswd closed 1 month ago

ForgotMyPasswd commented 2 months ago

When moving a window with 3-finger longpress, the window doesn't appear under my fingers as I would expect and instead appears in a corner and sometimes off the screen. In the video below, I am longpressing on the middle of the terminal window I'm trying to move and have to drag the window to the edges of my display to move them which means that I can't grab the window from the bottom as well as being generally very unintuitive.

https://github.com/horriblename/hyprgrass/assets/96489361/7b2ea997-019d-4e68-b005-571bb7384e2c

My config:

plugin:touch_gestures {
  # The default sensitivity is probably too low on tablet screens,
  # I recommend turning it up to 4.0
  sensitivity = 1.0

  # must be >= 3
  workspace_swipe_fingers = 3

  # switching workspaces by swiping from an edge, this is separate from workspace_swipe_fingers
  # and can be used at the same time
  # possible values: l, r, u, or d
  # to disable it set it to anything else
  workspace_swipe_edge = d

  # in milliseconds
  long_press_delay = 400

  experimental {
    # send proper cancel events to windows instead of hacky touch_up events,
    # NOT recommended as it crashed a few times, once it's stabilized I'll make it the default
    send_cancel = 0
  }
}

# longpress can trigger mouse binds:
bindm = , longpress:3, movewindow
horriblename commented 2 months ago

can you turn off cursor:hide_on_touch and record once more?

ForgotMyPasswd commented 2 months ago

Here is a video of the issue with that variable set. While the cursor does jump to the window, you can see my initial finger position from where the grabbed hand cursor appears at the start which is where I keep my fingers as I drag the window.

https://github.com/horriblename/hyprgrass/assets/96489361/4a4670db-4ccf-475c-b84a-3f7995217a77

horriblename commented 2 months ago

does #124 help?

ForgotMyPasswd commented 2 months ago

No, this did not fix the issue. edit: im stupid and didnt realise that the patch hasn't finished checks yet before updating through hyprpm

horriblename commented 2 months ago

125?

ForgotMyPasswd commented 2 months ago

Should I manually build the repo with these two draft commits? I haven't tried to install plugins manually or through other branches before

horriblename commented 2 months ago

you should be able to say which branch to build in hyprpm

horriblename commented 2 months ago

goddamn I couldn't find it, I'll just merge #125 and pray it doesn't explode xd

ForgotMyPasswd commented 2 months ago

I've tried the plugin with each of the revisions, neither of them worked. It could possibly be my configuration, but my touch inputs are being registered acccurately so I'm not sure.

ForgotMyPasswd commented 1 month ago

Managed to fix this by closing and opening my laptop lid, which I've set to lock my screen and trigger sleep mode. This is a reproducible fix for me. I don't know why it works, and it could possibly be an issue with my system specifically so if I need to provide some config files and logs I will. Otherwise I will close the issue for now.

horriblename commented 1 month ago

surprisingly you're not the first person to solve a hyprland problem by sleep

ForgotMyPasswd commented 1 month ago

I've managed to fix this problem by resetting the position offsets of my display in nwg-display, which I didn't even realise was set. This fixes the offset mouse gestures completely however it means that I can't place any other displays on the top or left edges of my laptop's display so that I can drag windows upwards to move them to my other monitor.

Edit: to clarify, waking the device from sleep fixes the misalignment if my monitor's coordinates are not set to 0 such as when I have another monitor connected but this can be very inconvenient. Edit2: typo

horriblename commented 1 month ago

if I understand correctly - if the monitor offset is not 0x0, the window is moved as if the monitor is placed at offset 0x0

sounds like #126