1
0
Fork 0
forked from wry/wry

ifs: init hyprland_focus_grab_manager_v1

This commit is contained in:
kossLAN 2026-04-06 23:42:38 -04:00
parent a75d388e97
commit 2591dc739b
No known key found for this signature in database
9 changed files with 315 additions and 4 deletions

View file

@ -83,8 +83,8 @@ use {
rect::Rect,
state::{DeviceHandlerData, State},
tree::{
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeLayer, NodeLayerLink,
NodeLocation, OutputNode, StackedNode, ToplevelNode, WorkspaceNode,
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeId, NodeLayer,
NodeLayerLink, NodeLocation, OutputNode, StackedNode, ToplevelNode, WorkspaceNode,
generic_node_visitor, toplevel_create_split, toplevel_parent_container,
toplevel_set_floating, toplevel_set_workspace,
},
@ -164,6 +164,11 @@ impl Drop for DroppedDnd {
}
}
pub trait SeatFocusGrab {
fn contains_node(&self, node_id: NodeId) -> bool;
fn clear(self: Rc<Self>);
}
linear_ids!(PhysicalKeyboardIds, PhysicalKeyboardId, u64);
pub struct PhysicalKeyboard {
@ -258,6 +263,7 @@ pub struct WlSeatGlobal {
warp_mouse_to_focus_scheduled: Cell<bool>,
warp_mouse_to_focus_skip_target_check: Cell<bool>,
mouse_follows_focus: Cell<bool>,
pub focus_grab: CloneCell<Option<Rc<dyn SeatFocusGrab>>>,
}
impl PartialEq for WlSeatGlobal {
@ -403,6 +409,7 @@ impl WlSeatGlobal {
warp_mouse_to_focus_scheduled: Cell::new(false),
warp_mouse_to_focus_skip_target_check: Cell::new(false),
mouse_follows_focus: Cell::new(false),
focus_grab: Default::default(),
});
slf.pointer_cursor.set_owner(slf.clone());
slf.modifiers_listener