fix(linux): apply the window title to frameless windows - #5960
fix(linux): apply the window title to frameless windows#5960julianstorer wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughLinux GTK3 and GTK4 window title updates now apply to frameless windows. The changelog records this behavior. ChangesLinux window title updates
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to This change makes frameless Linux windows receive and update their titles without affecting decorated windows; no actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the problem, technical cause, implementation, and expected behavior. However, it omits the issue link, selected change type, reproducible test instructions, Linux distribution and version, wails doctor output, and completed checklist items. Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 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 |
17605d9 to
a76a9a3
Compare
setTitle skipped gtk_window_set_title whenever the window was created with Frameless: true. newWindowImpl applies options.Title through that same method, so a frameless window never received a title at all, and every later SetTitle call was dropped too. On Linux the title is not a titlebar: gtk_window_set_title writes the WM_NAME/_NET_WM_NAME hints that taskbars, window switchers and pagers label the window with. Decorations are governed separately, by gtk_window_set_decorated in setFrameless/setBorderless, so titling an undecorated window draws nothing. The visible effect was that every window of a frameless application carried the same label — the g_set_prgname fallback — leaving multiple windows indistinguishable in the taskbar and in alt-tab. Applies to both the GTK4 and GTK3 backends.
a76a9a3 to
3596356
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Description
linuxWebviewWindow.setTitleskipsgtk_window_set_titleentirely when the window was created withFrameless: true:newWindowImplappliesoptions.Titlethrough that same method, so a frameless window never receives a title at all, and every laterSetTitlecall is dropped too. The window keeps whatever the WM falls back to — theg_set_prgnameprogram name — for its entire lifetime.The guard looks like it is protecting a titlebar, but on Linux the title is not a titlebar:
gtk_window_set_titlewrites theWM_NAME/_NET_WM_NAMEhints that taskbars, window switchers and pagers label the window with. It draws nothing on an undecorated window. Decorations are governed separately, bygtk_window_set_decoratedinsetFrameless/setBorderless, so removing this guard does not bring a titlebar back.The user-visible effect is that a frameless app with multiple windows shows the same label for every one of them, so they cannot be told apart in the taskbar or in alt-tab. This was reported against a frameless Wails app by a user on Cinnamon/X11, but it applies to any frameless window on any Linux desktop.
Windows (
SetWindowText) and macOS (setTitle:) have no equivalent guard, so this is Linux-only.Changes
Framelessguard fromsetTitlein both the GTK4 (linux_cgo.go) and GTK3 (linux_cgo_gtk3.go) backends, and note why the call is unconditional.v3/UNRELEASED_CHANGELOG.md.No API or behaviour change for decorated windows — for them this path was already running.
Testing
Verified by inspection and by the reported symptom: the change unwraps three unchanged statements from an
if, so decorated windows are unaffected, and frameless windows now get their_NET_WM_NAMEset at creation and on eachSetTitle.Worth a second pair of eyes from someone running a frameless v3 app on GTK4 and GTK3 to confirm the taskbar label updates as expected.
Summary by CodeRabbit