Skip to content

Commit

Permalink
fix: respond window floating change
Browse files Browse the repository at this point in the history
Sway doesn't create any events when dragging floating windows across
workspaces, but this will at least update the tree when window is set to
tiling again.
  • Loading branch information
roosta committed Jan 13, 2025
1 parent 3332915 commit d54d83f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ pub fn handle_window_event(
println!("{} Change: {:?}, Container: {:?}", "[WINDOW EVENT]".yellow(), e.change, e.container);
}
match e.change {
WindowChange::New | WindowChange::Close | WindowChange::Move | WindowChange::Title => {
WindowChange::New | WindowChange::Close | WindowChange::Move | WindowChange::Title | WindowChange::Floating => {
update_tree(conn, config, res, false)
.map_err(|e| AppError::Event(format!("Tree update failed: {}", e)))?;
}
Expand All @@ -377,6 +377,7 @@ pub fn handle_ws_event(
println!("{} Change: {:?}, Current: {:?}, Old: {:?}",
"[WORKSPACE EVENT]".green(), e.change, e.current, e.old);
}

match e.change {
WorkspaceChange::Empty | WorkspaceChange::Focus => {
update_tree(conn, config, res, e.change == WorkspaceChange::Focus)
Expand Down

0 comments on commit d54d83f

Please sign in to comment.