WIP Add an InputTime type to use instead of u32/u64 - #2108
Draft
ids1024 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
I've been wondering if it would be good if
timewas a newtype instead of just an integer for a while.Making the event structs in
src/inputusing microsecond precision instead of just millisecond would presumably be a prerequisite for https://wayland.app/protocols/input-timestamps-unstable-v1.But I ran into that trying to add
wl_keyboard.warp, as anis_warp: boolfield ofMotionEvent. (I'm still not entirely sure on doing that vs having a separateWarpEvent; if all the logic for handling it is the same as motion events, it may make sense and save a lot of duplication). But with a fallback to sendmotionand a 0relative_motionon clients not binding the latest version.relative_motionrequires a microsecond time.Going through this also reminds me that in some cases smithay synthesizes input events with a time of 0, which is probably not correct. In at least one place it synthesizes an event using
CLOCK_MONOTONIC. That does match libinput (https://wayland.freedesktop.org/libinput/doc/latest/timestamps.html) but technically isn't guranteed if we had a Wayland backend. I think X also was typicallyCLOCK_MONOTONICbut not technically guaranteed?I still need to update anvil/etc.
Checklist