diff --git a/src/input/mod.rs b/src/input/mod.rs index c93b3405..67780d53 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -3054,7 +3054,7 @@ pub fn update_output_image_copy_cursor_position( position: Point, ) { let output_geometry = output.geometry(); - for session in cursor_sessions_for_output(&shell, &output) { + for session in cursor_sessions_for_output(shell, output) { if let Some(cursor_geometry) = seat.cursor_geometry( (position - output_geometry.loc.to_f64()) .as_logical() diff --git a/src/wayland/handlers/xdg_shell/mod.rs b/src/wayland/handlers/xdg_shell/mod.rs index b8288019..b4f16c4c 100644 --- a/src/wayland/handlers/xdg_shell/mod.rs +++ b/src/wayland/handlers/xdg_shell/mod.rs @@ -333,17 +333,15 @@ impl XdgShellHandler for State { if let Some(ref grab) = grab { if grab.has_ended() { should_ungrab = true; - } else if let Some(target) = grab.current_grab() { - if let Some(wl_surface) = target.wl_surface() { - if wl_surface.as_ref() == surface.wl_surface() - || smithay::desktop::PopupManager::popups_for_surface( - surface.wl_surface(), - ) - .any(|(p, _)| p.wl_surface() == wl_surface.as_ref()) - { - should_ungrab = true; - } - } + } else if let Some(target) = grab.current_grab() + && let Some(wl_surface) = target.wl_surface() + && (wl_surface.as_ref() == surface.wl_surface() + || smithay::desktop::PopupManager::popups_for_surface( + surface.wl_surface(), + ) + .any(|(p, _)| p.wl_surface() == wl_surface.as_ref())) + { + should_ungrab = true; } } if should_ungrab {