Skip to content

fix: allow drag-dropping tabs into single-pane workspaces#78

Open
bvolpato wants to merge 3 commits into
am-will:mainfrom
bvolpato:fix/tab-drop-single-pane-workspace
Open

fix: allow drag-dropping tabs into single-pane workspaces#78
bvolpato wants to merge 3 commits into
am-will:mainfrom
bvolpato:fix/tab-drop-single-pane-workspace

Conversation

@bvolpato
Copy link
Copy Markdown
Contributor

@bvolpato bvolpato commented May 16, 2026

Problem: Dragging and dropping a tab onto another workspace only worked when the destination workspace had split panes. For single-pane workspaces, the drop silently failed.

Root cause: handle_tab_drop_to_workspace calls find_leaf_pane(&workspace.root, ...) to locate a target pane widget. workspace.root is a SplitTreeContainer bin (a gtk::Box). For workspaces with splits, the bin contains a gtk::Paned, so find_leaf_pane correctly descends into it. But for single-pane workspaces, the bin contains the pane widget directly, and find_leaf_pane was treating the bin itself as a leaf pane. This caused pane::move_tab_to_pane to fail because the bin doesn't have PaneInternals.

Fix: In find_leaf_pane, when encountering a gtk::Box that is not a pane widget, descend into its first child instead of returning the box as a leaf. The regression test now uses pane-shaped fixtures and asserts exact returned leaf widgets.

Verification:

  • cargo check -p limux-host-linux compiles cleanly in CI
  • All 187 limux-host-linux unit tests pass in CI
  • GitHub quality check passes: fmt, clippy, all workspace tests

The drag-and-drop plumbing for moving tabs between workspaces was
already in place, but dropping a tab onto a workspace with only a
single pane (no splits) silently failed.

Root cause: handle_tab_drop_to_workspace calls find_leaf_pane to
locate a target pane widget inside the destination workspace.
workspace.root is a SplitTreeContainer bin (a gtk::Box). For
workspaces with splits, the bin contains a gtk::Paned, so
find_leaf_pane correctly descends into it. But for single-pane
workspaces, the bin contains the pane widget directly, and
find_leaf_pane was treating the bin itself as a leaf pane. This
caused pane::move_tab_to_pane to fail because the bin doesn't have
PaneInternals.

Fix: in find_leaf_pane, when we encounter a gtk::Box that is not
a pane widget, descend into its first child instead of returning
the box as a leaf.
@bvolpato bvolpato marked this pull request as ready for review May 16, 2026 19:39
@bvolpato bvolpato force-pushed the fix/tab-drop-single-pane-workspace branch from 826c4bb to 64347a5 Compare May 17, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant