autosplit: better skip logic
This commit is contained in:
parent
5e236b2d3d
commit
d537999b8c
|
@ -165,12 +165,17 @@ async fn autosplit(
|
||||||
) -> Res<()> {
|
) -> Res<()> {
|
||||||
if node.node_type == swayipc_async::NodeType::Con {
|
if node.node_type == swayipc_async::NodeType::Con {
|
||||||
let (width, height) = (node.window_rect.width, node.window_rect.height);
|
let (width, height) = (node.window_rect.width, node.window_rect.height);
|
||||||
if width == 0 || height == 0 {
|
// we don't want to split zero-sized windows, but containers are also zero-sized
|
||||||
|
// - so only skip if size is 0 and we have no children
|
||||||
|
if (width == 0 || height == 0) && node.focus.is_empty() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
if tree
|
if tree
|
||||||
.find_as_ref(|n| n.focus.contains(&node.id))
|
.find_as_ref(|n| n.focus.contains(&node.id))
|
||||||
.is_some_and(|parent| parent.node_type != swayipc_async::NodeType::Workspace)
|
.is_some_and(|parent| {
|
||||||
|
parent.layout != swayipc_async::NodeLayout::SplitH
|
||||||
|
&& parent.layout != swayipc_async::NodeLayout::SplitV
|
||||||
|
})
|
||||||
{
|
{
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue