-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
eframe: Repaint immediately on RepaintAsap, fixes #903 #2280
Conversation
This completely eliminates the white flickering seen on Windows when rapidly resizing a window on the glow backend. The reason that happens is because DWM only waits for the resize event to be delivered before displaying the window at its new size. You must repaint synchronously inside that iteration of the event loop or else you get flickering.
RepaintNext looks like it is indeed needed in at least one case instead of RepaintAsap.
Starting to understand why this was the behavior. It looks like only a few special cases should be given RepaintAsap, such as the window being resized. All other cases should be RepaintNext, as it can wait. Using RepaintAsap in all situations will cause things like lag when changing a slider by keyboard with a high key repeat rate.
I am a total hypocrite for forgetting to add these.
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.
Interesting!
On my Mac I notice no difference. In particular, #903 is not solved.
But if this solves the white flickering on Windows, that's a big win!
There is no notion of "possibility" here like there is when waiting for RedrawEventsCleared. RepaintNow causes an immediate repaint no matter what.
Interesting. I also happen to have a Mac - would you like me to look into the stretching effect there? Just beware that that is likely a
It does, completely! To the point where resizing is perfectly smooth, take a look at this: firefox_zePsCkA2X7.mp4That is perfection. I did not know it was even possible to do that. But, somehow, eframe does it now, and it's amazing. |
It looks like this patch works as intended (glow is now perfect on Windows, even though wgpu still looks like crap; at least it didn't get worse); marking as ready for review. |
oh wait, I didn't realize that's what was going on. derp. GitHub is so unintuitive sometimes. Really sorry for the review request spam |
"Delays" is ambiguous.
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.
Awesome - thanks!
* eframe: Repaint immediately on RepaintAsap, fixes #903 This completely eliminates the white flickering seen on Windows when rapidly resizing a window on the glow backend. The reason that happens is because DWM only waits for the resize event to be delivered before displaying the window at its new size. You must repaint synchronously inside that iteration of the event loop or else you get flickering. * Differentiate between RepaintAsap and RepaintNext RepaintNext looks like it is indeed needed in at least one case instead of RepaintAsap. * Use RepaintNext in more situations Starting to understand why this was the behavior. It looks like only a few special cases should be given RepaintAsap, such as the window being resized. All other cases should be RepaintNext, as it can wait. Using RepaintAsap in all situations will cause things like lag when changing a slider by keyboard with a high key repeat rate. * Add explanatory comments I am a total hypocrite for forgetting to add these. * Rename RepaintAsap to RepaintNow There is no notion of "possibility" here like there is when waiting for RedrawEventsCleared. RepaintNow causes an immediate repaint no matter what. * Fix RepaintNow comment "Delays" is ambiguous.
* eframe: Repaint immediately on RepaintAsap, fixes emilk#903 This completely eliminates the white flickering seen on Windows when rapidly resizing a window on the glow backend. The reason that happens is because DWM only waits for the resize event to be delivered before displaying the window at its new size. You must repaint synchronously inside that iteration of the event loop or else you get flickering. * Differentiate between RepaintAsap and RepaintNext RepaintNext looks like it is indeed needed in at least one case instead of RepaintAsap. * Use RepaintNext in more situations Starting to understand why this was the behavior. It looks like only a few special cases should be given RepaintAsap, such as the window being resized. All other cases should be RepaintNext, as it can wait. Using RepaintAsap in all situations will cause things like lag when changing a slider by keyboard with a high key repeat rate. * Add explanatory comments I am a total hypocrite for forgetting to add these. * Rename RepaintAsap to RepaintNow There is no notion of "possibility" here like there is when waiting for RedrawEventsCleared. RepaintNow causes an immediate repaint no matter what. * Fix RepaintNow comment "Delays" is ambiguous.
Fixed #903
This completely eliminates the white flickering seen on Windows when rapidly resizing a window on the glow backend. The reason that happens is because DWM only waits for the resize event to be delivered before displaying the window at its new size. You must repaint synchronously inside that iteration of the event loop or else you get flickering.
Draft because there may be another reason why it was done this way; there was no comment explaining it so I am unsure.