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: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
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.
17605d9 to
a76a9a3
Compare
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