upgrade to libinput version 1.28 #79
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
i have updated the libinput bindings and wrapper functions to use. i have gradually updated to libinput 1.23, then 1.26, then 1.27 and finally to 1.28.
this pr is split up into commits that generate the ffi bindings and then another commit to use them in the rust wrapper crate
input, once per update to help with the review and to make it easier for me to implement the features in smaller increments and make the diffs more useful.if you prefer i can split this pr up into multiple smaller ones.
i have kept the default version of libinput at 1.21 for now, but i can increase it if you want.
notable changes for the updates:
libinput 1.23
1.23 introduced a new
AccelProfilestruct, that is not ref-counted, but has to be manually destroyed after every use. this makes it also notClone(which i think is the intent), as it would otherwise result in a double-free / use-after-free.in the original introduction of
libinput_config_accel_set_points, they didn't say that thepointsslice pointer wasconst, so bindgen generated a*mutpointer. for forward compatibility (as they changed that very recently and that will be included in the next release), i have decided to use aas _to support both*mutand*constdeclarations.libinput 1.26
1.26 was a relatively straightforward change, only adding new features (the new
ClickfingerButtonMap,TabletPadDialEvent, and pressure configuration for theTabletTool)the only somewhat interesting change is, that the docs for the
libinput_event_tablet_pad_get_ring_positionfunction was previously incorrectly claiming that the returned degrees are counterclockwise, while they are actually clockwise.libinput 1.27
this one was the most painful.
inputpreviously returned aboolforENABLEDandDISABLED, but libinput 1.27 now returns two new values,ENABLED_TIMEOUTandENABLED_STICKY, so i had to change the return type to an enum (DragLockState) with the three variantsDisabled,EnabledTimeoutandEnabledSticky, as the previousENABLEDvariant is just an alias forENABLED_TIMEOUT.this is, as far as i can tell, the only breaking change that this update introduced.
the additional addition of
config_area_set_rectanglewas less annoying though.libinput 1.28
the final upgrade to 1.28 was also pretty painless. i have decided to name the struct
ThreeFingerDragStatewith the variants ofEnabledThreeFingerandEnabledFourFinger(instead of using 3fg and 4fg), as theScrollMethodenum also does that withTwoFinger, though i decided against doing that for the function name as that was already verbose enough.