bugfix #17: fix for ghost node upon window move

This commit is contained in:
Matthew Kosarek 2024-02-02 08:29:30 -05:00
parent b8b4395ab8
commit 05deb43919
2 changed files with 14 additions and 3 deletions

View File

@ -22,7 +22,7 @@ Features:
- [x] Fullscreen application support
# 0.2.0
**Stabilization + Usability (Due: March 1st)**
**Stabilization + Usability (Due: March 15th)**
Features:
- [ ] Fix major bugs
@ -31,8 +31,9 @@ Features:
- [x] Action key
- [x] Keybindings
- [ ] Hot reloading
- [x] Startup apps
- [ ] Display configuration
- [ ] Workspaces
- [ ] Moving windows between workspaces
- [ ] Stacking windows
- [ ] Highlight border around selected window
- [ ] Fullscreen windows

View File

@ -236,7 +236,17 @@ bool WindowTree::try_move_active_window(miracle::Direction direction)
{
auto index = second_parent->get_index_of_node(second_window);
auto moving_node = active_window;
first_parent->remove_node(moving_node);
if (first_parent->num_nodes() == 1 && first_parent->get_parent())
{
// Remove the entire lane if this lane is now empty
auto prev_active = first_parent;
first_parent = first_parent->get_parent();
first_parent->remove_node(prev_active);
}
else
{
first_parent->remove_node(moving_node);
}
second_parent->insert_node(moving_node, index + 1);
}
return true;