Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Jun 13, 2024
1 parent 727edd9 commit 5daa386
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,6 @@ pub fn process_viewport_commands(
info: &mut ViewportInfo,
commands: impl IntoIterator<Item = ViewportCommand>,
window: &Window,
is_viewport_focused: bool,
actions_requested: &mut HashSet<ActionRequested>,
) {
for command in commands {
Expand All @@ -1293,7 +1292,6 @@ pub fn process_viewport_commands(
window,
command,
info,
is_viewport_focused,
actions_requested,
);
}
Expand All @@ -1304,7 +1302,6 @@ fn process_viewport_command(
window: &Window,
command: ViewportCommand,
info: &mut ViewportInfo,
is_viewport_focused: bool,
actions_requested: &mut HashSet<ActionRequested>,
) {
crate::profile_function!();
Expand All @@ -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}");
}
Expand Down

0 comments on commit 5daa386

Please sign in to comment.