1
0
Fork 0
forked from wry/wry

window-management: prevent dragging the root container

This commit is contained in:
Julian Orth 2026-01-16 14:16:22 +01:00
parent f16a95beeb
commit bcf2c8231d
2 changed files with 14 additions and 0 deletions

View file

@ -1137,6 +1137,9 @@ impl SimplePointerOwnerUsecase for WindowManagementUsecase {
let (mut dx, mut dy) = pos.translate(x, y);
let owner: Rc<dyn PointerOwner> = if button == BTN_LEFT {
if let Some(tl) = pn.clone().node_into_toplevel() {
if tl.tl_data().is_root_container() {
return false;
}
seat.pointer_cursor.set_known(KnownCursor::Move);
if tl.tl_data().is_fullscreen.get() {
Rc::new(ToplevelGrabPointerOwner {
@ -1578,6 +1581,10 @@ impl UiDragUsecase for TileDragUsecase {
}
fn apply_changes(&self, seat: &Rc<WlSeatGlobal>) -> Option<Rect> {
if self.tl.tl_data().is_root_container() {
self.destination.take();
return None;
}
let (x, y) = seat.pointer_cursor.position();
let dest = seat.state.root.tile_drag_destination(
self.tl.node_id(),

View file

@ -918,6 +918,13 @@ impl ToplevelData {
}
NodeLayerLink::Tiled
}
pub fn is_root_container(&self) -> bool {
let Some(parent) = self.parent.get() else {
return false;
};
parent.node_is_workspace()
}
}
impl Drop for ToplevelData {