-
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
Prevent the event loop from pausing when entering modal loop (eventloop-2.0) #839
Conversation
After clicking the window title bar or border (for a drag or resize), the event loop pauses until the mouse is moved. This change relays the WM_NCLBUTTONDOWN message to the dummy window where it queues a redraw and consumes the message. This effectively jumpstarts the modal loop and it continues to fire draw requests.
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.
Hi, and thanks for the PR!
There's one point that confused me a bit about this change, which I've commented on below. Once that's resolved, this should be good to merge.
} | ||
drop(runner); | ||
commctrl::DefSubclassProc(window, msg, wparam, lparam) | ||
}, |
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.
Why do you forward the WM_NCLBUTTONDOWN
message to the dummy window and trigger a redraw in there, instead of asking it to redraw directly from here?
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.
I checked again and also came to the conclusion that it's not necessary. I've pushed a new commit to remove the forwarding. I think it was leftover from sorting out the relationship with the dummy modal window.
Relaying the WM_NCLBUTTONDOWN message to the modal window turned out to be unnecessary.
…op-2.0) (rust-windowing#839) * Prevent the event loop from pausing after entering modal loop After clicking the window title bar or border (for a drag or resize), the event loop pauses until the mouse is moved. This change relays the WM_NCLBUTTONDOWN message to the dummy window where it queues a redraw and consumes the message. This effectively jumpstarts the modal loop and it continues to fire draw requests. * Handle WM_NCLBUTTONDOWN in public_window_callback instead of relaying. Relaying the WM_NCLBUTTONDOWN message to the modal window turned out to be unnecessary.
…op-2.0) (rust-windowing#839) * Prevent the event loop from pausing after entering modal loop After clicking the window title bar or border (for a drag or resize), the event loop pauses until the mouse is moved. This change relays the WM_NCLBUTTONDOWN message to the dummy window where it queues a redraw and consumes the message. This effectively jumpstarts the modal loop and it continues to fire draw requests. * Handle WM_NCLBUTTONDOWN in public_window_callback instead of relaying. Relaying the WM_NCLBUTTONDOWN message to the modal window turned out to be unnecessary.
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.
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.
After clicking the window title bar or border (for a drag or resize), the event loop pauses until the mouse is moved. This change relays the
WM_NCLBUTTONDOWN
message to the dummy window where it queues a redraw and consumes the message. This effectively jumpstarts the modal loop and it continues to fire draw requests.