diff options
Diffstat (limited to 'winit/src/multi_window.rs')
-rw-r--r-- | winit/src/multi_window.rs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs index 3b00200b..c9056c9f 100644 --- a/winit/src/multi_window.rs +++ b/winit/src/multi_window.rs @@ -993,26 +993,17 @@ fn run_command<A, C, E>( window.raw.set_minimized(minimized); } } - window::Action::Move(id, position) => { - if let Some(window) = window_manager.get_mut(id) { - window.raw.set_outer_position( - winit::dpi::LogicalPosition { - x: position.x, - y: position.y, - }, - ); - } - } - window::Action::FetchLocation(id, callback) => { + window::Action::FetchPosition(id, callback) => { if let Some(window) = window_manager.get_mut(id) { let position = window .raw .inner_position() - .map(|p| { - let pos = p.to_logical::<f32>( + .map(|position| { + let position = position.to_logical::<f32>( window.raw.scale_factor(), ); - crate::core::Point::new(pos.x, pos.y) + + crate::core::Point::new(position.x, position.y) }) .ok(); @@ -1021,6 +1012,16 @@ fn run_command<A, C, E>( .expect("Send message to event loop"); } } + window::Action::Move(id, position) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_outer_position( + winit::dpi::LogicalPosition { + x: position.x, + y: position.y, + }, + ); + } + } window::Action::ChangeMode(id, mode) => { if let Some(window) = window_manager.get_mut(id) { window.raw.set_visible(conversion::visible(mode)); |