From 4f6ed9dfc9bc71563c584a1dce51cee03d1cff49 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 18 Mar 2024 17:32:51 +0400 Subject: Fix lock surface pointer location --- src/niri.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/niri.rs b/src/niri.rs index d96e5e51..d5087d81 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -1627,6 +1627,7 @@ impl Niri { pos: Point, ) -> Option { let (output, pos_within_output) = self.output_under(pos)?; + let output_pos_in_global_space = self.global_space.output_geometry(output).unwrap().loc; if self.is_locked() { let state = self.output_state.get(output)?; @@ -1641,7 +1642,7 @@ impl Niri { )?; return Some(PointerFocus { output: output.clone(), - surface: (surface, point), + surface: (surface, point + output_pos_in_global_space), }); } @@ -1700,7 +1701,6 @@ impl Niri { .or_else(|| layer_surface_under(Layer::Bottom)) .or_else(|| layer_surface_under(Layer::Background))?; - let output_pos_in_global_space = self.global_space.output_geometry(output).unwrap().loc; let surface_loc_in_global_space = surface_pos_within_output + output_pos_in_global_space; Some(PointerFocus { -- cgit