window-management: prevent dragging the root container
This commit is contained in:
parent
f16a95beeb
commit
bcf2c8231d
2 changed files with 14 additions and 0 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue