Compare commits

...

3 commits

Author SHA1 Message Date
Alex Janka b47d623a05 only force tabbed on children of split 2024-09-25 14:39:45 +10:00
Alex Janka 5f1e1af97a remove commented out code 2024-09-25 14:37:41 +10:00
Alex Janka 98cb611cdd fix needless borrows 2024-09-25 11:04:29 +10:00
4 changed files with 9 additions and 8 deletions

2
Cargo.lock generated
View file

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

View file

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

View file

@ -1,7 +1,7 @@
# Maintainer: Alex Janka <alex@alexjanka.com>
pkgname=sway-flash-indicator
pkgver=0.6.1
pkgver=0.6.2
pkgrel=1
pkgdesc="flashes sway indicator border rather than always showing it"
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 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("layout tabbed").await?;
}
@ -190,7 +192,7 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
if workspace.focused {
let width = workspace.rect.width;
let mut workspace = get_with_id(&tree, workspace.id)?;
let mut workspace = get_with_id(tree, workspace.id)?;
if workspace
.output
.as_ref()
@ -213,8 +215,8 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
&& workspace.focus.len() == 2
{
let (code, other) = {
let a = get_with_id(&tree, workspace.focus[0])?;
let b = get_with_id(&tree, workspace.focus[1])?;
let a = get_with_id(tree, workspace.focus[0])?;
let b = get_with_id(tree, workspace.focus[1])?;
if contains_child(a, id) {
(a, b)
} else {
@ -233,7 +235,6 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
connection
.run_command(format!("swap container with con_id {}", other.id))
.await?;
// tokio::time::sleep(std::time::Duration::from_millis(50)).await;
}
connection