diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 9a57359887b..f0fe0e9be36 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -1284,7 +1284,6 @@ pub fn process_viewport_commands( info: &mut ViewportInfo, commands: impl IntoIterator, window: &Window, - is_viewport_focused: bool, actions_requested: &mut HashSet, ) { for command in commands { @@ -1293,7 +1292,6 @@ pub fn process_viewport_commands( window, command, info, - is_viewport_focused, actions_requested, ); } @@ -1304,7 +1302,6 @@ fn process_viewport_command( window: &Window, command: ViewportCommand, info: &mut ViewportInfo, - is_viewport_focused: bool, actions_requested: &mut HashSet, ) { crate::profile_function!(); @@ -1323,12 +1320,8 @@ fn process_viewport_command( // Need to be handled elsewhere } ViewportCommand::StartDrag => { - // If `is_viewport_focused` is not checked on x11 the input will be permanently taken until the app is killed! - - // TODO(emilk): check that the left mouse-button was pressed down recently, - // or we will have bugs on Windows. - // See https://github.com/emilk/egui/pull/1108 - if is_viewport_focused { + // If `.has_focus()` is not checked on x11 the input will be permanently taken until the app is killed! + if window.has_focus() { if let Err(err) = window.drag_window() { log::warn!("{command:?}: {err}"); }