diff --git a/Cargo.lock b/Cargo.lock index a1bfdd0..a7c6e09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -829,7 +829,7 @@ dependencies = [ [[package]] name = "swayipc" version = "3.0.1" -source = "git+https://github.com/pierrechevalier83/swayipc-rs.git?branch=fix_crash_when_using_without_i3_or_sway#e8eb2d8efba285b577c5e585af203baf9096b85f" +source = "git+https://github.com/chovanecadam/swayipc-rs.git?branch=master#bee50ead80ed5453da2c81cbdf213a25811f0a81" dependencies = [ "serde", "serde_json", @@ -839,7 +839,7 @@ dependencies = [ [[package]] name = "swayipc-types" version = "1.3.0" -source = "git+https://github.com/pierrechevalier83/swayipc-rs.git?branch=fix_crash_when_using_without_i3_or_sway#e8eb2d8efba285b577c5e585af203baf9096b85f" +source = "git+https://github.com/chovanecadam/swayipc-rs.git?branch=master#bee50ead80ed5453da2c81cbdf213a25811f0a81" dependencies = [ "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index d75f3cb..7bd05c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ serde_derive = "1.0" lockfile = "0.3.0" anyhow = "1.0" indexmap = "1.8" -swayipc = { git = "https://github.com/pierrechevalier83/swayipc-rs.git", branch = "fix_crash_when_using_without_i3_or_sway" } +swayipc = { git = "https://github.com/chovanecadam/swayipc-rs.git", branch = "master" } once_cell = "1.9" diff --git a/src/window_manager.rs b/src/window_manager.rs index eb2b686..2854da5 100644 --- a/src/window_manager.rs +++ b/src/window_manager.rs @@ -8,7 +8,7 @@ use itertools::Itertools; use std::collections::BTreeMap; use std::sync::{mpsc, mpsc::Receiver}; use std::thread; -use swayipc::{Connection, EventStream, EventType, Node, NodeType}; +use swayipc::{Connection, EventStream, EventType, Floating, Node, NodeType}; trait NodeExt { fn is_workspace(&self) -> bool; @@ -86,7 +86,18 @@ impl Window { let name = node.name(); let app_id = node.app_id(); let window_properties_class = node.window_properties_class(); - if name.is_some() || app_id.is_some() || window_properties_class.is_some() { + + let sway_floating: bool = node.node_type == NodeType::FloatingCon; + let i3_floating: bool = match node.floating { + Some(Floating::UserOn) => true, + Some(Floating::AutoOn) => true, + Some(_) => false, + None => false, + }; + + if !(node.sticky && (sway_floating || i3_floating)) + && (name.is_some() || app_id.is_some() || window_properties_class.is_some()) + { Some(Self { name, app_id,