mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 21:30:03 -04:00
Discard mouse down after Cocoa window resize (#466)
* Discard mouse down after Cocoa window resize We are sending the mouse down event after the window resize has completed, because Cocoa uses a modal event loop to implement window resize. This leads to a mouse down without a matching mouse up. * Also handle event discard in poll_events Add some explanatory comments and a changelog entry.
This commit is contained in:
committed by
Francesca Frangipane
parent
2477d8ce46
commit
19cd53193b
@@ -87,6 +87,11 @@ impl WindowDelegate {
|
||||
let state: *mut c_void = *this.get_ivar("winitState");
|
||||
let state = &mut *(state as *mut DelegateState);
|
||||
emit_resize_event(state);
|
||||
|
||||
// discard the pending mouse down event
|
||||
if let Some(shared) = state.shared.upgrade() {
|
||||
shared.discard_next_event();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user