-
Notifications
You must be signed in to change notification settings - Fork 947
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 a pause in the event loop when clicking the title bar on windows #4136
base: master
Are you sure you want to change the base?
Conversation
Will this fix #1885 too? |
Yes |
When clicking the title bar on Windows, to drag the window, there is a noticible pause in continuous redraw requests. This was fixed in rust-windowing#839 and then regressed in rust-windowing#1852. The cursor blinks in both cases and is unrelated. The regression made the blink happen after the pause instead of immediately.
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.
So, I would quite like to get this fix in, as I believe it's desired by Bevy people, but we don't really have a Windows maintainer at the moment, and I don't feel like I understand enough of what's going on here myself to confidently merge this.
Maybe you could expand on why the PostMessageW
is necessary in the first place (why is the default handler not sufficient?), why passing lparam = 0
is correct, and if you know, how we'd go about fixing the blinking then? Ideally as code-comments with links to official docs, makes it easier to track in the future.
To be honest, I fixed this 6 years ago and I don't really remember the details. I noticed it had regressed while exploring something else. The blinking happens even when the entire The short pause is ingrained in how Windows works. If you start dragging the window immediately when you click, you won't notice a pause. I think what's happening is that the dummy I'm completely speculating here, but I'm guessing that windows is computing a delta to determine drag status and What I can't wrap my head around is that the In summary, this is absolutely a hacky work-around :) The actual robust and generally accepted solution is to execute your simulation and rendering logic from a different thread. |
Thanks a lot for the context! I'd be okay with merging this if you included basically the block of text you wrote here as a code comment. |
When clicking the title bar on Windows, to drag the window, there is a noticeable ~500ms pause in continuous redraw requests. This was fixed in #839 and then regressed in #1852. The cursor blinks in both cases and is unrelated. The regression made the blink happen after the pause instead of immediately.
changelog
module if knowledge of this change could be valuable to users