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;
|
||||
}
|
||||
|
||||
let cursor_pos = Some(
|
||||
event
|
||||
.location
|
||||
.to_buffer(1.0, Transform::Normal, &toplevel.geometry().size.to_f64())
|
||||
.to_i32_round(),
|
||||
);
|
||||
let cursor_pos = if let Some(_wl_surface) = self.wl_surface() {
|
||||
Some(
|
||||
event
|
||||
.location
|
||||
.to_buffer(1.0, Transform::Normal, &toplevel.geometry().size.to_f64())
|
||||
.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)) =
|
||||
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