workspace/layout: Resize windows/groups

This commit is contained in:
Victoria Brekenfeld 2023-07-06 00:02:29 +02:00
parent f5dcd97c42
commit 2004705080
4 changed files with 404 additions and 183 deletions

View file

@ -3,6 +3,7 @@ use std::sync::Weak;
use crate::{
shell::{element::CosmicMapped, CosmicSurface},
utils::prelude::*,
wayland::handlers::xdg_shell::popup::get_popup_toplevel,
};
use id_tree::NodeId;
use smithay::{
@ -50,6 +51,16 @@ impl From<KeyboardFocusTarget> for PointerFocusTarget {
}
}
impl KeyboardFocusTarget {
pub fn toplevel(&self) -> Option<WlSurface> {
match self {
KeyboardFocusTarget::Element(mapped) => mapped.wl_surface(),
KeyboardFocusTarget::Popup(PopupKind::Xdg(xdg)) => get_popup_toplevel(&xdg),
_ => None,
}
}
}
#[derive(Debug, Clone)]
pub struct WindowGroup {
pub node: NodeId,