-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 continuous RunMode in glium backend #21
Conversation
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 for the PR!
Prior to this patch, the
Continuous
run mode didn't work correctly in the glium backend
Can you elaborate what was incorrect? For me master
works as it should, i.e. repainting at 60 FPS on my 60 Hz display..
I ask, because trying this PR the Reactive
mode is now definitely broken on my Mac: it repaints the GUI even when the window is in the background (the point of the Reactive
mode is to avoid unnecessary repaints).
On Windows 10, both modes act completely identically. No updates occur unless an event is delivered (especially moving the mouse cursor). I believe this is caused by a bug in winit. See rust-windowing/winit#987 and rust-windowing/winit#1619
|
ebb0d79
to
7444b51
Compare
@emilk I force-pushed a new patch for this. Tested on Windows and macOS. I haven't tested on Linux (X11 or Wayland). Neither event handler I also had to add another |
7444b51
to
7bc05fd
Compare
And rebased on master. |
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.
Great, nice work!
A bit late here, but this fix doesn't work as expected for me. RedrawEventsCleared is raised at the vsync frequency, causing the Reactive mode to behave as Continuous. Removing the platform-dependent handling and responding to RedrawRequested only does the work on my machine. Is this fix still needed? Using master on Windows 10 btw. |
There are two I also see that |
The primary change here is that the
winit
control flow is set according toRunMode
, and not assumed to beWait
. I also had to change the event handler toRedrawEventsCleared
.Prior to this patch, the
Continuous
run mode didn't work correctly in the glium backend. But it does work as expected in the web backend.