fix(launch): use native window drag for HUD grip on Linux - #141
fix(launch): use native window drag for HUD grip on Linux#141EtienneLescot 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 |
|
shipped in pre-release |
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