-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Basic Touch Support #185
Basic Touch Support #185
Conversation
e91a1c2
to
63e8fb1
Compare
799bffd
to
00932a7
Compare
@@ -171,6 +172,9 @@ impl State { | |||
let desc = TabletDescriptor::from(&device); | |||
tablet_seat.add_tablet::<Self>(&self.niri.display_handle, &desc); | |||
} | |||
if device.has_capability(DeviceCapability::Touch) && self.niri.seat.get_touch().is_none() { | |||
self.niri.seat.add_touch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to remove it in on_device_removed()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, yeah. Added some tracking for touch devices and to remove touch support when the last touch device has been removed.
let under = self | ||
.niri | ||
.surface_under_and_global_space(touch_location) | ||
.map(|under| under.surface); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to activate window / output under touch here, just like we do for mouse and tablet clicks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially intended on adding that through bindings on global gestures. But I guess for now we can just activate the window similar to pointer button. One important difference is that I added a check if there is a touch grab and in this case not activate a window. I added that to prevent stealing the window on multiple touches.
00932a7
to
0a250ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't have a touch device to test, but code wise looks good.
Thanks! |
decided to give it a try despite being unfinished in smithay.lacks testing, proper output selection, doesn't work properly with output transform,...
but hey, touch seems to work so far on my laptop :)
based on Smithay/smithay#1326mergedSo, with the touch refactor merged in smithay it is time to finally finish basic touch support in niri