Skip to content

fix(linux): keep the Wayland HUD expanded so menus are not clipped - #949

Open
fabri404 wants to merge 1 commit into
webadderallorg:mainfrom
fabri404:fix/linux-wayland-hud-menus
Open

fabri404 wants to merge 1 commit into
webadderallorg:mainfrom
fabri404:fix/linux-wayland-hud-menus

Conversation

@fabri404

@fabri404 fabri404 commented Sep 13, 2026

Copy link
Copy Markdown

Description

On Linux the HUD falls back to a compact 860×160 window (mouse passthrough is not supported), so popovers that open above the toolbar (webcam, "more" menu, etc.) are clipped by the window bounds. On Wayland sessions the HUD is now created pre-expanded (860×540) and never resized at runtime.

Motivation

Resizing the HUD at runtime is unstable on Wayland: compositors ignore client-side positioning, so growing the window moves the bar away from the pointer (the approach in e2802bf was reverted for this reason). Creating the window at its expanded size avoids both the clipping and the oscillation. X11, Windows and macOS keep the current behaviour.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

Related to #891 and #772. Overlaps with the open PRs #876 and #919, which take a similar Wayland-gated approach — happy to close this in favour of whichever maintainers prefer.

Testing Guide

  1. Run npm run dev in a Wayland session (tested on GNOME Wayland, Ubuntu).
  2. Open the webcam / "more" popovers from the HUD: they render fully instead of being cut at the top.
  3. npx vitest --run electron/hudOverlayBounds.test.ts covers Wayland detection and the always-expanded bounds.

Known trade-off: on Linux the transparent part of the 860×540 window still captures clicks while the HUD is idle.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

🤖 Generated with claude-flow

https://claude.ai/code/session_014WWof1pMnhBVJuJzNreUoB

Summary by CodeRabbit

  • Bug Fixes
    • Improved HUD overlay behavior on Linux Wayland sessions.
    • HUD fallback expansion now remains active when client-side repositioning is unavailable, including when webcam preview is hidden.
    • Added reliable detection for Wayland sessions using common system environment indicators.

On Linux the HUD falls back to an 860x160 window because mouse passthrough
is unsupported, so popovers opened above the toolbar were cut off. Resizing
at runtime is unstable on Wayland (compositors ignore client positioning and
the bar oscillates), so Wayland sessions now create the HUD pre-expanded.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_014WWof1pMnhBVJuJzNreUoB
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3b6b2daf-0ab2-4d9c-81e1-5b573ff796da

📥 Commits

Reviewing files that changed from the base of the PR and between 8b9b106 and 8e16974.

📒 Files selected for processing (3)
  • electron/hudOverlayBounds.test.ts
  • electron/hudOverlayBounds.ts
  • electron/windows.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The HUD overlay now detects Linux Wayland sessions and forces fallback expansion during those sessions. The bounds calculation passes the detected session state, and tests cover Wayland detection and fallback behavior.

Changes

Wayland HUD overlay handling

Layer / File(s) Summary
Wayland detection and fallback decision
electron/hudOverlayBounds.ts
isWaylandSession detects Linux Wayland sessions from XDG_SESSION_TYPE or WAYLAND_DISPLAY. shouldExpandHudOverlayFallback accepts the optional session state and returns true for Wayland.
HUD wiring and validation
electron/windows.ts, electron/hudOverlayBounds.test.ts
getHudOverlayBounds passes the detected Wayland state to the fallback decision. Tests cover forced expansion and Linux, X11, and non-Linux session detection.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: webadderall

Merge Risk: ⚪ Minimal · up to 8e169

Wayland sessions now keep the HUD expanded to avoid compositor repositioning issues, while other platforms retain their existing behavior. The change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: keeping the Linux Wayland HUD expanded to prevent clipped menus.
Description check ✅ Passed The description covers the purpose, motivation, bug-fix type, related issues, testing steps, known trade-off, and checklist. Screenshots are not provided, but they are optional and not required for th…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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