forge
Explore
Log in

Don't you dare go Hollow

Fix lock surface pointer location

Browse files at this commit

4f6ed9dfc9bc71563c584a1dce51cee03d1cff49Ivan MolodetskikhParent: 8430279
src/niri.rsmodified+2 -2
@@ -1627,6 +1627,7 @@ impl Niri {
1627 pos: Point<f64, Logical>,1627 pos: Point<f64, Logical>,
1628 ) -> Option<PointerFocus> {1628 ) -> Option<PointerFocus> {
1629 let (output, pos_within_output) = self.output_under(pos)?;1629 let (output, pos_within_output) = self.output_under(pos)?;
1630+ let output_pos_in_global_space = self.global_space.output_geometry(output).unwrap().loc;
1630 1631
1631 if self.is_locked() {1632 if self.is_locked() {
1632 let state = self.output_state.get(output)?;1633 let state = self.output_state.get(output)?;
@@ -1641,7 +1642,7 @@ impl Niri {
1641 )?;1642 )?;
1642 return Some(PointerFocus {1643 return Some(PointerFocus {
1643 output: output.clone(),1644 output: output.clone(),
1644- surface: (surface, point),1645+ surface: (surface, point + output_pos_in_global_space),
1645 });1646 });
1646 }1647 }
1647 1648
@@ -1700,7 +1701,6 @@ impl Niri {
1700 .or_else(|| layer_surface_under(Layer::Bottom))1701 .or_else(|| layer_surface_under(Layer::Bottom))
1701 .or_else(|| layer_surface_under(Layer::Background))?;1702 .or_else(|| layer_surface_under(Layer::Background))?;
1702 1703
1703- let output_pos_in_global_space = self.global_space.output_geometry(output).unwrap().loc;
1704 let surface_loc_in_global_space = surface_pos_within_output + output_pos_in_global_space;1704 let surface_loc_in_global_space = surface_pos_within_output + output_pos_in_global_space;
1705 1705
1706 Some(PointerFocus {1706 Some(PointerFocus {