Skip to content

Basic Touch Support#185

Merged
YaLTeR merged 2 commits intoniri-wm:mainfrom
cmeissl:feature/touch
Feb 28, 2024
Merged

Basic Touch Support#185
YaLTeR merged 2 commits intoniri-wm:mainfrom
cmeissl:feature/touch

Conversation

@cmeissl
Copy link
Copy Markdown
Contributor

@cmeissl cmeissl commented Feb 11, 2024

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#1326 merged

So, with the touch refactor merged in smithay it is time to finally finish basic touch support in niri

@cmeissl cmeissl force-pushed the feature/touch branch 3 times, most recently from e91a1c2 to 63e8fb1 Compare February 13, 2024 20:23
@cmeissl cmeissl force-pushed the feature/touch branch 5 times, most recently from 799bffd to 00932a7 Compare February 24, 2024 18:33
@cmeissl cmeissl marked this pull request as ready for review February 24, 2024 18:38
Comment thread src/input.rs
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();
Copy link
Copy Markdown
Member

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()?

Copy link
Copy Markdown
Contributor Author

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.

Comment thread src/input.rs
let under = self
.niri
.surface_under_and_global_space(touch_location)
.map(|under| under.surface);
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Contributor Author

@cmeissl cmeissl Feb 27, 2024

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.

Copy link
Copy Markdown
Member

@YaLTeR YaLTeR left a 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.

@YaLTeR YaLTeR merged commit 7196971 into niri-wm:main Feb 28, 2024
@YaLTeR
Copy link
Copy Markdown
Member

YaLTeR commented Feb 28, 2024

Thanks!

@YaLTeR YaLTeR mentioned this pull request Feb 28, 2024
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

Successfully merging this pull request may close these issues.

2 participants