fix(launch): use native window drag for HUD grip on Linux#141
Open
EtienneLescot wants to merge 1 commit into
Open
fix(launch): use native window drag for HUD grip on Linux#141EtienneLescot wants to merge 1 commit into
EtienneLescot wants to merge 1 commit into
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe HUD drag handle now uses native Electron dragging on Linux, including Wayland, while retaining pointer-based drag handlers and styling on non-Linux platforms. ChangesHUD dragging
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 channelhud-overlay-move-byinelectron/windows.ts). Wayland compositors don't allow clients to reposition their own top-level window outside of an OS-initiated interactive move, sosetPosition()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 ofsetPosition().Fix: on Linux (
isLinuxHud), the grip handle now uses the same native-webkit-app-region: dragmechanism 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 todarwin, unaffected)tsc --noEmit— only pre-existing, unrelated missing-optional-dependency errorsbiome check— cleanFixes #140
Summary by CodeRabbit