mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-23 10:26:34 +11:00
Prevent the event loop from pausing when entering modal loop (eventloop-2.0) (#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.
This commit is contained in:
parent
2ead1c1c59
commit
2253565db5
1 changed files with 14 additions and 0 deletions
|
@ -799,6 +799,20 @@ unsafe extern "system" fn public_window_callback<T>(
|
||||||
commctrl::DefSubclassProc(window, msg, wparam, lparam)
|
commctrl::DefSubclassProc(window, msg, wparam, lparam)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
winuser::WM_NCLBUTTONDOWN => {
|
||||||
|
// jumpstart the modal loop
|
||||||
|
winuser::RedrawWindow(
|
||||||
|
window,
|
||||||
|
ptr::null(),
|
||||||
|
ptr::null_mut(),
|
||||||
|
winuser::RDW_INTERNALPAINT
|
||||||
|
);
|
||||||
|
if wparam == winuser::HTCAPTION as _ {
|
||||||
|
winuser::PostMessageW(window, winuser::WM_MOUSEMOVE, 0, 0);
|
||||||
|
}
|
||||||
|
commctrl::DefSubclassProc(window, msg, wparam, lparam)
|
||||||
|
},
|
||||||
|
|
||||||
winuser::WM_CLOSE => {
|
winuser::WM_CLOSE => {
|
||||||
use event::WindowEvent::CloseRequested;
|
use event::WindowEvent::CloseRequested;
|
||||||
subclass_input.send_event(Event::WindowEvent {
|
subclass_input.send_event(Event::WindowEvent {
|
||||||
|
|
Loading…
Add table
Reference in a new issue