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

mapping between gtk timestamp and instant #1290

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Doublonmousse
Copy link
Collaborator

@Doublonmousse Doublonmousse commented Nov 12, 2024

Fixes #1289

I'm not sure if I need to take into account the overflow, this complicates things quite a bit.
It's a little bit ugly, but it's probably enough to test things out.

I'm getting a lot of 0 for event times when scrolling, I need to see what event triggers this so there isn't any residual weirdness.

Well, it seems every single scroll event will trigger a MotionNotify without a timestamp.

@Doublonmousse
Copy link
Collaborator Author

More weirdness :

  • two events can be sent with the same gtk time (hence why the backlog policy is useful, even if it's to put it at 1 ms)
  • scroll events don't have timestamps (I think that would only affect things when scrolling with the left click pressed)

@Doublonmousse
Copy link
Collaborator Author

After thinking a bit, I'm not sure if I'm not making a bit deal of a (relatively) small issue. We have a timestamp for all events, albeit sometimes less precise than gtk when it gives it, with larger deviations in the case of the ButtonPress for pen on windows. But for all time sensitive algorithm, as long as we do the following

  • reject negative time deltas
  • robustness to time deltas that are too small (compared to their real duration)
    Things will be fine.

Maybe I can check on my hardware by how much doing the Instant::now vs relying on gtk time changes things

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.

Incorrect timings on event from using Instant::now
1 participant