Skip to content

fix(launch): use native window drag for HUD grip on Linux#141

Open
EtienneLescot wants to merge 1 commit into
mainfrom
claude/openscreen-drag-handle-fedora-c51e4d
Open

fix(launch): use native window drag for HUD grip on Linux#141
EtienneLescot wants to merge 1 commit into
mainfrom
claude/openscreen-drag-handle-fedora-c51e4d

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #140: on Linux (notably Wayland), dragging the HUD recorder bar by its 6-dot grip handle did nothing, while dragging by the bar's border worked and the grip drag threw a JS error.

Root cause: the grip's drag repositions the HUD via a custom pointer-capture handler that calls BrowserWindow.setPosition() (IPC channel hud-overlay-move-by in electron/windows.ts). Wayland compositors don't allow clients to reposition their own top-level window outside of an OS-initiated interactive move, so setPosition() is effectively a no-op there. The border already works because it uses native -webkit-app-region: drag, which goes through the compositor's own move gesture instead of setPosition().

Fix: on Linux (isLinuxHud), the grip handle now uses the same native -webkit-app-region: drag mechanism as the border, instead of the pointer-capture/IPC path. macOS and Windows are unaffected — they keep the existing pointer-capture drag (including the drift-fix from #125).

Test plan

  • vitest run src/components/launch/LaunchWindow.test.tsx — 14/14 pass (existing drag test pins platform to darwin, unaffected)
  • tsc --noEmit — only pre-existing, unrelated missing-optional-dependency errors
  • biome check — clean
  • Manual verification on Linux/Wayland (can't be done from this Windows dev environment — would appreciate a check from someone with a Linux box, or via the reporter re-testing)

Fixes #140

Summary by CodeRabbit

  • Bug Fixes
    • Improved HUD window dragging on Linux, including Wayland environments.
    • Linux users can now move the window using the native operating system drag behavior.

BrowserWindow.setPosition(), which the grip's pointer-capture drag
relies on, is a no-op on Wayland compositors -- clients can't
reposition their own top-level window outside an OS-initiated
interactive move. Fall back to -webkit-app-region: drag there, same
mechanism the HUD bar's border already uses successfully.

Fixes #140
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 092c14b9-79ee-4d06-88b6-336f5165864d

📥 Commits

Reviewing files that changed from the base of the PR and between fe5e95b and 384eb4e.

📒 Files selected for processing (1)
  • src/components/launch/LaunchWindow.tsx

📝 Walkthrough

Walkthrough

The HUD drag handle now uses native Electron dragging on Linux, including Wayland, while retaining pointer-based drag handlers and styling on non-Linux platforms.

Changes

HUD dragging

Layer / File(s) Summary
Platform-aware drag handle
src/components/launch/LaunchWindow.tsx
The drag handle applies Linux-specific Electron drag styling and disables pointer capture handlers on Linux while preserving existing pointer behavior elsewhere.

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

Possibly related issues

Possibly related PRs

Suggested reviewers: siddharthvaddem

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: native Linux window dragging for the HUD grip.
Description check ✅ Passed The description covers the summary, linked issue, and testing, though several template sections like type, release impact, and desktop impact are unfilled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/openscreen-drag-handle-fedora-c51e4d

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.

[Bug]: HUD drag handle (6 dots) doesn't move the window on Linux/Wayland

1 participant