Skip to content

helium/linux: middle-click on empty tab strip opens new tab#268

Open
saberoueslati wants to merge 2 commits intoimputnet:mainfrom
saberoueslati:helium/linux/middle-click-tab-strip-opens-new-tab
Open

helium/linux: middle-click on empty tab strip opens new tab#268
saberoueslati wants to merge 2 commits intoimputnet:mainfrom
saberoueslati:helium/linux/middle-click-tab-strip-opens-new-tab

Conversation

@saberoueslati
Copy link
Copy Markdown

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.
    If such issue did not exist before, I opened one.
  • 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.
  • The pull request contents are only relevant to the Linux platform, and can in
    no way be applied to other platforms.

Closes imputnet/helium#654.

Manual test below :

Screencast.from.2026-04-26.03-04-37.webm

Modifications made :

Added OnMousePressed and OnMouseReleased to the TabStrip view class and FrameGrabHandle class to handle the middle click event, Added an early return in OnClickedCaption() when the event is a middle-click, which is a Linux-specific blocker that stops the middle click on the empty tab space from reducing the window.

Struggling so far to build Helium on Windows to test the patch there but I'm pretty sure the patch is applicable there without the OnClickedCaption() change

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 26, 2026

Reviews (1): Last reviewed commit: "helium/linux: middle-click on empty tab ..." | Re-trigger Greptile

Comment thread patches/series Outdated
Comment on lines +74 to +78
} else if (event->changed_button_flags() & ui::EF_MIDDLE_MOUSE_BUTTON) {
- action_type = ui::LinuxUi::WindowFrameActionSource::kMiddleClick;
- default_action = ui::LinuxUi::WindowFrameAction::kNone;
+ // Let the views hierarchy handle middle click (e.g. tab strip opens new tab).
+ return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Early return bypasses all DE-configured middle-click-caption actions

The early return in OnClickedCaption skips calling GetWindowFrameAction(kMiddleClick, ...) globally, not just for the tab strip. Users who have configured a desktop environment action for middle-clicking the title bar (e.g. lower window, minimize) will silently lose that behaviour even when clicking on window chrome outside the tab strip. The previous code already defaulted to kNone, so most users are unaffected, but this is a broader behavioral change than the PR description implies. It would be worth a comment in the code noting that DE middle-click-caption actions are intentionally suppressed browser-wide.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, they will lose that behavior indeed, and it is intentional, I'll add the comment if the reviewer wants me to

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.

[FR]: Middle-click to open new tab

1 participant