shell: resize_request better handle tiled windows

This commit is contained in:
Victoria Brekenfeld 2024-03-07 16:54:19 +01:00
parent 20123927e0
commit e7f746ccee
2 changed files with 82 additions and 59 deletions

View file

@ -2443,7 +2443,7 @@ impl TilingLayout {
edges
}
pub fn menu_resize(
pub fn resize_request(
&self,
mut node_id: NodeId,
edge: ResizeEdge,

View file

@ -2871,13 +2871,37 @@ impl Shell {
return;
};
if let Some(grab) = floating_layer.resize_request(
let grab: ResizeGrab = if let Some(grab) = floating_layer.resize_request(
&mapped,
seat,
start_data.clone(),
edges,
ReleaseMode::NoMouseButtons,
) {
grab.into()
} else if let Some(ws) = state.common.shell.space_for_mut(&mapped) {
let Some(node_id) = mapped.tiling_node_id.lock().unwrap().clone() else {
return;
};
let Some((node, left_up_idx, orientation)) =
ws.tiling_layer.resize_request(node_id, edges)
else {
return;
};
ResizeForkGrab::new(
start_data,
seat.get_pointer().unwrap().current_location().as_global(),
node,
left_up_idx,
orientation,
ws.output.downgrade(),
ReleaseMode::NoMouseButtons,
)
.into()
} else {
return;
};
seat.get_pointer().unwrap().set_grab(
state,
grab,
@ -2887,7 +2911,6 @@ impl Shell {
}
}
}
}
pub fn resize(&mut self, seat: &Seat<State>, direction: ResizeDirection, edge: ResizeEdge) {
let output = seat.active_output();