fix some floating windows being split
This commit is contained in:
parent
ab95a4b019
commit
b6bc571b52
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -653,7 +653,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sway-flash-indicator"
|
name = "sway-flash-indicator"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"directories",
|
"directories",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sway-flash-indicator"
|
name = "sway-flash-indicator"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -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.2.0
|
pkgver=0.2.1
|
||||||
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')
|
||||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -60,13 +60,16 @@ async fn main() -> Res<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
swayipc_async::Event::Window(window)
|
swayipc_async::Event::Window(window)
|
||||||
// TODO: change on window closed also
|
|
||||||
// the node we're given is the one that closes
|
|
||||||
if window.change != swayipc_async::WindowChange::Mark =>
|
if window.change != swayipc_async::WindowChange::Mark =>
|
||||||
{
|
{
|
||||||
|
// TODO: also change on window closed -
|
||||||
|
// the node we're given is the one that closes
|
||||||
let node = window.container;
|
let node = window.container;
|
||||||
|
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 {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let ratio = (width as f64) / (height as f64);
|
let ratio = (width as f64) / (height as f64);
|
||||||
let autosplit_ratio =
|
let autosplit_ratio =
|
||||||
CONFIG.get().ok_or(Error::NoMatchingConfig)?.autosplit_ratio;
|
CONFIG.get().ok_or(Error::NoMatchingConfig)?.autosplit_ratio;
|
||||||
|
@ -78,6 +81,7 @@ async fn main() -> Res<()> {
|
||||||
log::warn!("error {e:?} setting split");
|
log::warn!("error {e:?} setting split");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue