image-copy: Fix cursor pos for toplevels with SSD
This commit is contained in:
parent
8aea6cc158
commit
7a50625e78
1 changed files with 11 additions and 6 deletions
|
|
@ -241,12 +241,17 @@ impl PointerFocusTarget {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cursor_pos = Some(
|
let cursor_pos = if let Some(_wl_surface) = self.wl_surface() {
|
||||||
|
Some(
|
||||||
event
|
event
|
||||||
.location
|
.location
|
||||||
.to_buffer(1.0, Transform::Normal, &toplevel.geometry().size.to_f64())
|
.to_buffer(1.0, Transform::Normal, &toplevel.geometry().size.to_f64())
|
||||||
.to_i32_round(),
|
.to_i32_round(),
|
||||||
);
|
)
|
||||||
|
} else {
|
||||||
|
// If cursor is in SSD, instead of a `wl_surface`, it is outside the captured bounds
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
let cursor_hotspot = if let Some((_, hotspot)) =
|
let cursor_hotspot = if let Some((_, hotspot)) =
|
||||||
seat.cursor_geometry((0.0, 0.0), Duration::from_millis(event.time as u64).into())
|
seat.cursor_geometry((0.0, 0.0), Duration::from_millis(event.time as u64).into())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue