shell: implement surface_offset and surface_tree_offset
This commit is contained in:
parent
22fe419747
commit
32b54cc31f
2 changed files with 74 additions and 1 deletions
|
|
@ -254,6 +254,14 @@ impl CosmicMapped {
|
|||
.any(|(w, _)| w.has_surface(surface, surface_type))
|
||||
}
|
||||
|
||||
pub fn surface_offset(&self, surface: &WlSurface) -> Option<Point<i32, Logical>> {
|
||||
self.windows().find_map(|(window, window_offset)| {
|
||||
window
|
||||
.surface_offset(surface)
|
||||
.map(|offset| window_offset + offset)
|
||||
})
|
||||
}
|
||||
|
||||
/// Give the pointer target under a relative offset into this element.
|
||||
///
|
||||
/// Returns Target + Offset relative to the target
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue