Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Basic Touch Support (?) #28

Open
nine7nine opened this issue Apr 20, 2024 · 9 comments
Open

Add Basic Touch Support (?) #28

nine7nine opened this issue Apr 20, 2024 · 9 comments

Comments

@nine7nine
Copy link
Contributor

Hey @KZDKM

It would be nice if Hyprspace had basic touch support. Not necessarily anything fancy like gestures, but at least the ability to do the following:

  1. Touch a workspace and have have it selected / move to the workspace
  2. Touch/hold a window with autoDrag and have it move the window

Currently, it doesn't register any input from touch events (which Hyprland does support). IIRC, Hyprland also does support touch gestures, but at least for me: I already have a 3 finger multi-touch gesture for toggling Hyprspace + the expanders (dead-space) in my Panel/Topbar trigger toggling it too, with a mouse/Stylus click or touch event....

In any case, it would be awesome if Hyprspace handled basic touch events, as sometimes I do use my device as a tablet (even sometimes without using my stylus).

@KZDKM
Copy link
Owner

KZDKM commented Apr 20, 2024

Yes, I forgot that touch input events have a separate protocol. This would be easy to fix, I just had to add touch event hooks and call the corresponding input function. Since the plugin hooks into swipe event, touch gestures could be fixed with hyprgrass as it emulates swipe event.

@nine7nine
Copy link
Contributor Author

Yeah, I use hyprgrass for gestures / swipes -> but obviously that has nothing to do with actual point-click single touch, which is the more basic bit that needs to be handled in Hyprspace.

@KZDKM
Copy link
Owner

KZDKM commented Apr 24, 2024

Sorry I'm bogged down with other stuff recently. See 2203e58.

This is untested as I do not have touchscreen to test it with right now. Please report whether if the implementation works.

@nine7nine
Copy link
Contributor Author

no worries at all!

I'll give your commit a whirl, tonight -- when I am home.

@nine7nine
Copy link
Contributor Author

So I tested this -- it doesn't appear to work. However, I am wondering if it may actually be an issue in Hyprland.

Hyprland handles touch in a funny way / non-parity with mouse/click events.

For example: If i have 2 floating windows in Hyprland

  • A mouse click will make the window active && change the z order / bring it to the front.
  • A touch event will make the window active, but will NOT change the z order bring it to the front.

So I am not positive that your implementation isn't working or is wrong -- it may be an issue with how Hyprland is handling the touch events, itself. ~ I will file an issue about it.

@KZDKM
Copy link
Owner

KZDKM commented Apr 26, 2024

I just realized that the touch coordinate sent through the touch event should be scaled by monitor's size. The newest commit should fix it. However, a recent change was introduced in hyprland git that broke compatibility with older versions, so to test it you have to change to hyprland-git.

Hyprland handles touch in a funny way / non-parity with mouse/click events.

Indeed, however this is to be expected as any-half decent touch input system implementation should not simply emulate mouse clicks.

@nine7nine
Copy link
Contributor Author

I'll give it a whirl and let you know... and yeah, no worries: I'm using hyprland-git / I'm aware of the registerCallbackDynamic() breaking API change.

Agreed, that it shoudn't emulate mouse clicks -- but at the same time, in the example I gave; hyprland clearly is actually doing the wrong thing. a touch event SHOULD affect the z order / bring the active window to the front.

@smathles
Copy link

Any possibility this is still on the scope? Found a similar/related issue on hyprgrass, not sure what the current touchscreen support scopt is like (touch still broken for me on arch + thinkpad T480s).

Relevant thread in hyprgrass here

@ForgotMyPasswd
Copy link

I can confirm that on Hyprland 0.45.0 with the hyprgrass and hyprspace plugins installed, this can be done by assigning a longpress to movewindow in hypgrass and using that same gesture in the overview, which also has touch support fixed. There isn't a way to scroll through workspaces with a touchscreen currently, but it is still mostly usable with only touch input unless I use too many workspaces which need to be scrolled through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants