From 18814338da776134da7413a1202cbd4127ef5faf Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Tue, 24 Sep 2024 15:14:43 +1000 Subject: [PATCH] autosplit misfires --- Cargo.lock | 2 +- Cargo.toml | 2 +- packaging/PKGBUILD | 2 +- src/main.rs | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59836a2..92c5697 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1041,7 +1041,7 @@ dependencies = [ [[package]] name = "sway-flash-indicator" -version = "0.6.0" +version = "0.6.1" dependencies = [ "directories", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index 0f74ba6..c060008 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sway-flash-indicator" -version = "0.6.0" +version = "0.6.1" edition = "2021" [dependencies] diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index 81ae13f..2853434 100644 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Alex Janka pkgname=sway-flash-indicator -pkgver=0.6.0 +pkgver=0.6.1 pkgrel=1 pkgdesc="flashes sway indicator border rather than always showing it" arch=('x86_64' 'aarch64') diff --git a/src/main.rs b/src/main.rs index 4c49229..89a7476 100644 --- a/src/main.rs +++ b/src/main.rs @@ -122,7 +122,10 @@ async fn main() -> Res<()> { // TODO: also change on window closed - // the node we're given is the one that closes - if window.change != swayipc_async::WindowChange::Close { + if window.change == swayipc_async::WindowChange::Focus + && node.focused + && tree.find_as_ref(|n| n.id == node.id).is_some() + { autosplit(&node, &tree, &mut command_connection).await?; } }