-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix the last remaining races in fyne_demo #5382
Conversation
This adds appropriate safety in groutines and also moves the advanced tab to only redraw when settings actually change (it was incorrectly drawing each second before).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this Jacob.
Just a quick question - are you sure it will update with changes to texture scale? (When a window drags to a non-retina screen on macOS...
I think that's why the timer was there.
Good point. I think it also will be wrong when just dragging between two windows with different DPI, right? I'll change the code to only refresh the widgets when scale changes instead :) |
I think @andydotxyz was talking about the label that shows the scale info, not the widgets themselves not getting redrawn? The driver handles refreshing the window when the scale changes. |
Indeed, I know. I just meant that I would try to make the existing code a bit faster by not redrawing/refreshing them when the scale hasn't changed. I'm not a huge fan of an infinite loop with refresh each second. |
I guess just be careful because texScale is not a scale change, it's an internal detail to the GLFW windows... |
I ended up just moving to the old once per second update but tidied up the code a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of the animation construct :)
Thanks. I was rather happy with the one as well. Haven't used it before actually. Now we're just trying to get the flaky Ubuntu test to work :) |
Description:
This adds appropriate safety in goroutines and also moves the advanced tab to only redraw when settings actually change (it was drawing each second before and wasting CPU time). I clicked through all the tabs now and can no longer see any races reported.
For #4654
Fixes #4568
Checklist: