Skip to content

fix(linux): apply the window title to frameless windows - #5960

Open
julianstorer wants to merge 1 commit into
wailsapp:masterfrom
juggler-ai:fix/linux-frameless-window-title
Open

fix(linux): apply the window title to frameless windows#5960
julianstorer wants to merge 1 commit into
wailsapp:masterfrom
juggler-ai:fix/linux-frameless-window-title

Conversation

@julianstorer

@julianstorer julianstorer commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

linuxWebviewWindow.setTitle skips gtk_window_set_title entirely when the window was created with Frameless: true:

func (w *linuxWebviewWindow) setTitle(title string) {
	if !w.parent.options.Frameless {
		...
	}
}

newWindowImpl applies options.Title through that same method, so a frameless window never receives a title at all, and every later SetTitle call is dropped too. The window keeps whatever the WM falls back to — the g_set_prgname program 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_title writes the WM_NAME / _NET_WM_NAME hints that taskbars, window switchers and pagers label the window with. It draws nothing on an undecorated window. Decorations are governed separately, by gtk_window_set_decorated in setFrameless / 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

  • Remove the Frameless guard from setTitle in both the GTK4 (linux_cgo.go) and GTK3 (linux_cgo_gtk3.go) backends, and note why the call is unconditional.
  • Add an entry to 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_NAME set at creation and on each SetTitle.

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

  • Bug Fixes
    • Frameless Linux windows now display their titles in taskbars and window switchers.
    • Window titles are applied consistently across supported GTK versions.

@github-actions github-actions Bot added Documentation Improvements or additions to documentation v3 labels Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 74872807-6088-479b-8b38-1775a89aee8b

📥 Commits

Reviewing files that changed from the base of the PR and between 17605d9 and a76a9a3.

📒 Files selected for processing (1)
  • v3/UNRELEASED_CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • v3/UNRELEASED_CHANGELOG.md

Walkthrough

Linux GTK3 and GTK4 window title updates now apply to frameless windows. The changelog records this behavior.

Changes

Linux window title updates

Layer / File(s) Summary
Apply titles to frameless windows
v3/pkg/application/linux_cgo.go, v3/pkg/application/linux_cgo_gtk3.go, v3/UNRELEASED_CHANGELOG.md
GTK3 and GTK4 setTitle methods now assign titles without a frameless-window check. The changelog records the update.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested labels: Linux

Suggested reviewers: leaanthony

Poem

A rabbit checks the title bar bright,
Frameless windows show their names right.
GTK hops in, both three and four,
Taskbars know each window’s door.
Carrots cheer the changelog light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the Linux frameless-window title fix.
Description check ✅ Passed The description clearly explains the issue, implementation, impact, and testing, but omits the issue link, test configuration, and completed checklists.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.
@julianstorer
julianstorer force-pushed the fix/linux-frameless-window-title branch from 17605d9 to a76a9a3 Compare August 12, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant