only force tabbed on children of split

This commit is contained in:
Alex Janka 2024-09-25 14:39:45 +10:00
parent 5f1e1af97a
commit b47d623a05
4 changed files with 6 additions and 4 deletions

2
Cargo.lock generated
View file

@ -1041,7 +1041,7 @@ dependencies = [
[[package]] [[package]]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.6.1" version = "0.6.2"
dependencies = [ dependencies = [
"directories", "directories",
"futures-util", "futures-util",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.6.1" version = "0.6.2"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

View file

@ -1,7 +1,7 @@
# Maintainer: Alex Janka <alex@alexjanka.com> # Maintainer: Alex Janka <alex@alexjanka.com>
pkgname=sway-flash-indicator pkgname=sway-flash-indicator
pkgver=0.6.1 pkgver=0.6.2
pkgrel=1 pkgrel=1
pkgdesc="flashes sway indicator border rather than always showing it" pkgdesc="flashes sway indicator border rather than always showing it"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')

View file

@ -86,7 +86,9 @@ async fn main() -> Res<()> {
}) })
{ {
if let Some(parent) = tree.find_as_ref(|n| n.focus.contains(&node.id)) { if let Some(parent) = tree.find_as_ref(|n| n.focus.contains(&node.id)) {
if parent.layout != swayipc_async::NodeLayout::Tabbed { if parent.layout == swayipc_async::NodeLayout::SplitH
|| parent.layout == swayipc_async::NodeLayout::SplitV
{
command_connection.run_command("splith").await?; command_connection.run_command("splith").await?;
command_connection.run_command("layout tabbed").await?; command_connection.run_command("layout tabbed").await?;
} }