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

Relative pointer protocol #757

Merged
merged 2 commits into from
Jan 24, 2023
Merged

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Sep 19, 2022

I wonder if any of this could be simpler and less redundant...

Needs testing and probably some corrections.

@ids1024
Copy link
Member Author

ids1024 commented Sep 21, 2022

I'm not sure how best to test this protocol on it's own. I think in first person games it tends to be used together with zwp_pointer_constraints_v1. Need to see about implementing that one.

@Drakulix
Copy link
Member

I'm not sure how best to test this protocol on it's own.

Maybe the wine-wayland-patchset supports it?

Also wlcs actually seems to have some relative-pointer tests, if you feel like enabling those tests for wlcs_anvil.
https://github.com/MirServer/wlcs/blob/main/src/relative_pointer_unstable_v1.cpp

@ids1024
Copy link
Member Author

ids1024 commented Sep 21, 2022

Enabled the wlcs test for this, though it seems fairly rudimentary so it isn't really a complete test for relative pointer functionality.

@ids1024 ids1024 force-pushed the relative-pointer branch 2 times, most recently from cd31070 to 03c844e Compare January 12, 2023 23:13
@ids1024 ids1024 force-pushed the relative-pointer branch 4 times, most recently from e271425 to 5c4c906 Compare January 23, 2023 20:01
Add helper for the relative pointer protocol, and a way to send relative
pointer events to clients. This also exposes unaccelerated vectors and
microsecond timestamps in pointer events from the libinput backend.

Enables `wlcs` relative pointer test, though what `wlcs` currently
handles seems to be limited at this point.

Adds relative pointer support for Anvil, exposing the global only on the
`udev` backend so clients won't use the protocol but get no events.
@ids1024 ids1024 changed the title WIP relative pointer protocol Relative pointer protocol Jan 23, 2023
@ids1024 ids1024 marked this pull request as ready for review January 23, 2023 20:27
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2023

Codecov Report

Base: 25.27% // Head: 25.34% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (3cfdcd7) compared to base (ffbc84e).
Patch coverage: 34.13% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #757      +/-   ##
==========================================
+ Coverage   25.27%   25.34%   +0.07%     
==========================================
  Files         130      131       +1     
  Lines       20882    21123     +241     
==========================================
+ Hits         5277     5354      +77     
- Misses      15605    15769     +164     
Flag Coverage Δ
wlcs-core 22.41% <2.81%> (-0.24%) ⬇️
wlcs-output 10.28% <2.81%> (-0.10%) ⬇️
wlcs-pointer-input 24.60% <34.13%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
anvil/src/input_handler.rs 9.02% <0.00%> (ø)
anvil/src/shell/grabs.rs 1.54% <0.00%> (-0.16%) ⬇️
src/backend/input/mod.rs 0.00% <0.00%> (ø)
src/desktop/wayland/layer.rs 9.49% <0.00%> (-0.08%) ⬇️
src/desktop/wayland/popup/grab.rs 0.00% <0.00%> (ø)
src/input/mod.rs 52.63% <ø> (ø)
src/wayland/data_device/dnd_grab.rs 0.00% <0.00%> (ø)
src/wayland/data_device/server_dnd_grab.rs 0.00% <0.00%> (ø)
src/wayland/relative_pointer.rs 0.00% <0.00%> (ø)
src/wayland/seat/pointer.rs 19.17% <30.76%> (+1.56%) ⬆️
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ids1024
Copy link
Member Author

ids1024 commented Jan 23, 2023

I've removed the somewhat incomplete pointer constraints implementation, and the remaining issues here should be fixed now. Pointer constraints can be added in a later PR.

Real use cases seem to typically use this with pointer constraints, but https://github.com/Smithay/client-toolkit/blob/master/examples/relative_pointer.rs can demonstrate that a client receives the correct events.

Copy link
Member

@PolyMeilex PolyMeilex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick, but in general looks reasonable to me.

Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, expect utime vs time. Can we unify those? What makes the relative-motion event have a higher precision?

`PointerMotionEvent` now doesn't need a separate `utime` method for
relative pointer events.
@Drakulix Drakulix merged commit 87e869e into Smithay:master Jan 24, 2023
@ids1024 ids1024 deleted the relative-pointer branch January 24, 2023 17:51
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.

4 participants