Skip to content

helium/vertical: fix system DnD reattachment for vertical tabs#948

Open
alexng353 wants to merge 2 commits intoimputnet:mainfrom
alexng353:alex/fix-vertical-tab-reattachment
Open

helium/vertical: fix system DnD reattachment for vertical tabs#948
alexng353 wants to merge 2 commits intoimputnet:mainfrom
alexng353:alex/fix-vertical-tab-reattachment

Conversation

@alexng353
Copy link
Copy Markdown

Two changes:

  1. Add system DnD support (CanDrop, GetDropFormats, OnDragEntered, OnDragUpdated, OnDragExited) to VerticalTabStripRegionView so that vertical tabs can be reattached via system drag-and-drop on Wayland where move loops are not supported.

  2. Fix bounds check in GetTabDragTarget to use the region view's bounds instead of the tab strip view's bounds. The strip view shrinks when tabs are removed during detachment, causing all reattachment attempts to fail because the cursor falls outside the shrunken bounds.

For your pull request to not get closed without review, please confirm that:

  • An issue exists where the maintainers agreed that this should be implemented
    (an approved feature request, or confirmed bug).
  • I tested that my contribution works locally, and does not break anything,
    otherwise I have marked my PR as draft.
  • If my contribution is non-trivial, I did not use AI to write most of it.
  • I understand that I will be permanently banned from interacting with this
    organization if I lied by checking any of these checkboxes.

Tested on (check one or more):

  • Windows
  • macOS
  • Linux

I didn't get an AI to write most of it, but I did have an AI walk me through how the chromium source code works, how the browser handles reattachment, etc. It took me like 2 days to diagnose what was even happening, and this is my first ever contribution to a C++ codebase. Please be very careful looking over the patch provided, as I myself am unaware of the full inner-workings of the tab system. I basically copied code from the horizontal tab system that was missing from the vertical one.

I had to modify another patch, but Claude said that was bad, so instead I had it add another patch in-between the existing patches. Also, I had Claude generate the patches because I mistakenly wrote the code in the chromium build/src directory, which is not exactly where I should have written it.

Thanks!


fixes: #947
fixes: imputnet/helium-linux#201

Copy link
Copy Markdown
Member

@wukko wukko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has claude generated the patches directly? that’s not how it should be done, the description alone is definitely hallucinated.

read through this and generate patches properly please: https://github.com/imputnet/helium-macos/blob/main/docs/building.md#basics

p.s. codex is way better at working with helium

@alexng353
Copy link
Copy Markdown
Author

read through this and generate patches properly please: https://github.com/imputnet/helium-macos/blob/main/docs/building.md#basics

Wait, I didn't even see that. Thanks.

I don't have codex, sorry. Will fix. Also, this introduces a stupid bug that I thought I fixed but was missed in the patch generation. I'll take a look when I next have time, sorry.

Two patches:

1. fix-bounds-check-in-get-tab-drag-target: Use the region view's
   bounds instead of the tab strip view's bounds in GetTabDragTarget.
   The strip view shrinks when tabs are removed during detachment,
   causing reattachment to fail.

2. add-system-dnd-support-to-vertical-tab-strip: Add CanDrop,
   GetDropFormats, OnDragEntered, OnDragUpdated, and OnDragExited to
   VerticalTabStripRegionView so vertical tabs can be reattached via
   system DnD on Wayland.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexng353 alexng353 force-pushed the alex/fix-vertical-tab-reattachment branch from 591ffda to 4273382 Compare February 19, 2026 06:24
@alexng353
Copy link
Copy Markdown
Author

Updated the patches to use the correct way of generating them. I have introduced a crash bug

  • Detach tab
  • Attempt to attach another tab to the freshly created helium instance
  • Crash

Marking as draft until I resolve this.

@alexng353 alexng353 marked this pull request as draft February 19, 2026 06:28
Tab reattachment via system DnD (Wayland) can cause a CHECK failure
when the drag controller is destroyed because of a SetCapture() conflict
with Wayland's drag grab.
@alexng353 alexng353 marked this pull request as ready for review February 19, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants