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

Avoid undefined behaviour in GTK animation frames #1832

Merged
merged 12 commits into from
Jun 27, 2021

Conversation

JAicewizard
Copy link
Contributor

Requestion an animation frame is and always has been undefined behaviour.
This is not documented ANYWHERE besides the brains of whoever coded this.
See https://gitlab.gnome.org/GNOME/gtk/-/issues/3703.

@JAicewizard
Copy link
Contributor Author

Before merging, someone else please confirm that this code works. I currently cannot compile druid (AGAIN!!!! FFS rust how is this even possible. How can it never just WORK).

This is copied straight out of my gtk4 code which did work.
To test you can try running the anim example, and also see if the text widget updates properly (both without moving your mouse, as that causes a new frame anyways).

@maan2003
Copy link
Collaborator

Both examples are working fine.

Requesting an animation frame is and always has been undefined behaviour.
This is not documented ANYWHERE

sounds horrible 😬

I believe this only affects druid-shell because druid doesn't let you request animation frame when painting (at type level!)

CI is red due to new clippy lints (in 1.53)

I currently cannot compile druid (AGAIN!!!! FFS rust how is this even possible. How can it never just WORK).

I would love to know why. if you are bellow rustc 1.51 then it can solved by commenting out the const generic data impl for array

@JAicewizard
Copy link
Contributor Author

I believe this only affects druid-shell because druid doesn't let you request animation frame when painting (at type level!)

No!!! because we base the whole cycle druid lifecycle on GTK draw events, including update. This is the only real option, since there isnt many other events this could be put into.

I would love to know why. if you are bellow rustc 1.51 then it can solved by commenting out the const generic data impl for array

no I tried all channels. I didnt have much time today, I will try to reinstall rust all together. That didnt fix things last time, but it might now 🤷

@maan2003
Copy link
Collaborator

rebasing should solve the CI issues now

@JAicewizard JAicewizard force-pushed the avoid_undefined_behaviour branch from 8f19c31 to 5203cd7 Compare June 23, 2021 09:36
@JAicewizard
Copy link
Contributor Author

CI seems fixed 👍

@JAicewizard
Copy link
Contributor Author

welp, as github seems to have broken itself, CI fails. I tested the new code and works as before.

Copy link
Collaborator

@maan2003 maan2003 left a comment

Choose a reason for hiding this comment

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

Thanks! Both animation and textbox examples are working

@maan2003 maan2003 merged commit bc99cd0 into linebender:master Jun 27, 2021
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