mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
Send mouse position after focused/cursorenter events (#349)
* Update mouse pos after cursor enter event * Update mouse position on windows focus * Send device_id * Update other device id * Fix windows import * Remove deque for vec * Just send event * Use correct push_back method * Push correct event
This commit is contained in:
committed by
Victor Berger
parent
fae10c6072
commit
0f14e63b34
@@ -673,11 +673,19 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
|
||||
},
|
||||
|
||||
winapi::WM_SETFOCUS => {
|
||||
use events::WindowEvent::Focused;
|
||||
use events::WindowEvent::{Focused, CursorMoved};
|
||||
send_event(Event::WindowEvent {
|
||||
window_id: SuperWindowId(WindowId(window)),
|
||||
event: Focused(true)
|
||||
});
|
||||
|
||||
let x = winapi::GET_X_LPARAM(lparam) as f64;
|
||||
let y = winapi::GET_Y_LPARAM(lparam) as f64;
|
||||
|
||||
send_event(Event::WindowEvent {
|
||||
window_id: SuperWindowId(WindowId(window)),
|
||||
event: CursorMoved { device_id: DEVICE_ID, position: (x, y) },
|
||||
});
|
||||
0
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user