fix(linux): frameless window resize + scrollbar edge detection#5493
fix(linux): frameless window resize + scrollbar edge detection#5493taliesin-ai wants to merge 1 commit into
Conversation
- Enable JS-side resize handling for Linux frameless windows by syncing the frameless and resizable flags into the runtime on page load and whenever setFrameless/setResizable are called at runtime. - Fix border detection in drag.ts to use innerWidth/innerHeight minus the scrollbar width (from documentElement.clientWidth diff) rather than outerWidth/outerHeight, so the resize hit zone doesn't overlap the scrollbar strip. - Import IsLinux in drag.ts; gate the resize-edge logic on IsLinux() && frameless (mirrors the existing Windows-only gate). Rebuilding the compiled runtime bundles (runtime.js / runtime.debug.js) requires running `task runtime:build` in v3/internal/runtime/desktop/@wailsio/runtime. Supersedes PR wailsapp#5368 (rebased, typo-fixed, addressed CodeRabbit review).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR fixes frameless window resizing on Linux and scrollbar-related resize edge detection on all platforms. Frontend resize logic now enables Linux frameless windows and compensates for scrollbar width in edge detection. Native bindings synchronize resizable and frameless state changes to the frontend via JavaScript, and startup initialization ensures correct initial state. ChangesLinux frameless window resize and scrollbar edge detection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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 |
|
Status update on the recurring FOSSA errors: A separate PR is being opened to fix the root cause — This PR (#5493) itself has no new dependencies and no FOSSA-flagged packages in its changes. This PR is ready for review. It is rebased and applies cleanly against current master ( CC @leaanthony Taliesin is an AI agent. CC @leaanthony |
Problem
On Linux frameless windows, the JS runtime never received the
framelessorresizableflags, so the resize-edge cursor logic indrag.tsnever activated. Additionally, the existing border detection usedwindow.outerWidth/outerHeightwhich does not account for a scrollbar occupying the rightmost/bottommost strip — making it impossible to hit the resize zone when a scrollbar was present.Changes
drag.tsIsLinuxfromsystem.js!IsWindows() && !(IsLinux() && frameless)→ frameless Linux windows now enter the resize pathouterWidth/outerHeightborder math withinnerWidth - scrollbarWidth/innerHeight - scrollbarHeight(scrollbar width derived fromwindow.innerWidth - document.documentElement.clientWidth)linux_cgo.go(GTK3) /linux_cgo_gtk4.go(GTK4)setResizable: callwindow._wails.setResizable(bool)after the GTK call so runtime state stays in sync when resizability is toggled at runtimesetFrameless: callwindow._wails.flags.frameless = boolaftergtk_window_set_decoratedwebview_window_linux.goWindowLoadFinishedhook, injectflags.framelessandsetResizable(bool)alongside the existingenableFileDropflag so every fresh page load gets correct stateNotes
runtime.js/runtime.debug.js) need regenerating withtask runtime:buildinv3/internal/runtime/desktop/@wailsio/runtime— the TS source is the ground truth.outerWidthvsinnerWidth).Closes #5368
CC @leaanthony
Summary by CodeRabbit