shell: implement has_surface for KeyboardFocusTarget
This commit is contained in:
parent
32b54cc31f
commit
d829ec3815
1 changed files with 12 additions and 0 deletions
|
|
@ -281,6 +281,18 @@ impl KeyboardFocusTarget {
|
|||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub fn has_surface(&self, shell: &Shell, surface: &WlSurface) -> bool {
|
||||
if let Some(fe) = shell.focused_element(self) {
|
||||
fe.has_surface(surface, WindowSurfaceType::ALL)
|
||||
} else if let KeyboardFocusTarget::Fullscreen(s) = self {
|
||||
s.has_surface(surface, WindowSurfaceType::ALL)
|
||||
} else if let Some(root) = WaylandFocus::wl_surface(self) {
|
||||
CosmicSurface::surface_tree_offset(&root, surface).is_some()
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue