Skip to content

fix(v3/linux): always advertise the tray Menu property so a tray created after Run is not dropped - #6284

Merged
leaanthony merged 4 commits into
wailsapp:masterfrom
Rethunk-AI:fix/v3-linux-tray-menu-before-setmenu
Oct 27, 2026
Merged

leaanthony merged 4 commits into
wailsapp:masterfrom
Rethunk-AI:fix/v3-linux-tray-menu-before-setmenu

Conversation

@AlbinoGeek

@AlbinoGeek AlbinoGeek commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

createPropSpec adds the StatusNotifierItem Menu property only when s.menu is already set. A system tray created after the app is running registers with the host straight away, before the app calls SetMenu, so its item is exported without Menu. Hosts such as GNOME's AppIndicator extension drop an item whose Menu property is missing, and the tray never appears.

The dbusmenu object is exported at menuPath whether or not a menu has been set, so the property is now always advertised.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • WEP (proposal only; no implementation)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • go build ./pkg/application and the package's tray tests (go test ./pkg/application -run Tray) pass.
  • No new unit test: the item being dropped is the host's behaviour, seen with GNOME's AppIndicator extension.
  • Windows
  • macOS
  • Linux

Fedora Linux 44 (Workstation Edition), amd64, GNOME on Wayland.

Test Configuration

Tests run with Go 1.26.9 against master at 73242d1. wails3 doctor on the same machine (its Go line is the toolchain the CLI was built with):

wails3 doctor
# System

┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Name                | Fedora Linux                                                                                                          |
| Version             | 44                                                                                                                    |
| ID                  | fedora                                                                                                                |
| Branding            | 44 (Workstation Edition)                                                                                              |
| Platform            | linux                                                                                                                 |
| Architecture        | amd64                                                                                                                 |
| Desktop Environment | GNOME                                                                                                                 |
| NVIDIA Driver       | N/A                                                                                                                   |
| XDG_SESSION_TYPE    | wayland                                                                                                               |
| CPU                 | AMD RYZEN AI MAX+ 395 w/ Radeon 8060S                                                                                 |
| GPU                 | Strix Halo [Radeon Graphics / Radeon 8050S Graphics / Radeon 8060S Graphics] (Advanced Micro Devices, Inc. [AMD/ATI]) |
| Memory              | 128GB                                                                                                                 |
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-beta.30                                                                                                                  |
| Go Version     | go1.27.2                                                                                                                        |
| -buildmode     | exe                                                                                                                             |
| -compiler      | gc                                                                                                                              |
| CGO_CFLAGS     |                                                                                                                                 |
| CGO_CPPFLAGS   |                                                                                                                                 |
| CGO_CXXFLAGS   |                                                                                                                                 |
| CGO_ENABLED    | 1                                                                                                                               |
| CGO_LDFLAGS    |                                                                                                                                 |
| DefaultGODEBUG | cryptocustomrand=1,httpservecontentmaxranges=1,tlssecpmlkem=0,tracebacklabels=0,urlstrictcolons=0,x509sslcertoverrideplatform=0 |
| GOAMD64        | v1                                                                                                                              |
| GOARCH         | amd64                                                                                                                           |
| GOOS           | linux                                                                                                                           |
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies

┌───────────────────────────────────────────────────────────────────────────────────────────┐
| *Android NDK            | ~/Android/Sdk/ndk/27.1.12297006                  |
| *Android SDK            | ~/Android/Sdk                                    |
| *Android platform-tools | Installed                                                       |
| *Java (Android)         | openjdk version "17.0.20.1" 2026-08-18                          |
| gcc                     | 16.2.1-2.fc44                                                   |
| gtk3 (legacy)           | 3.24.52-2.fc44                                                  |
| gtk4                    | 4.22.5-2.fc44                                                   |
| npm                     | 11.16.0                                                         |
| pkg-config              | 2.5.1-1.fc44                                                    |
| webkit2gtk (legacy)     | 2.54.1-1.fc44                                                   |
| webkitgtk-6.0           | 2.54.1-1.fc44                                                   |
| docker                  | *Docker version 29.9.1, build dfc520d (cross-compilation ready) |
|                                                                                           |
└───────────────────────────────── * - Optional Dependency ─────────────────────────────────┘

# Signing

┌────────────────────────────────────────┐
| macOS Signing   | Not configured       |
| Windows Signing | Not configured       |
| Linux Signing   | Not configured (GPG) |
└────────────────────────────────────────┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 SUCCESS  Your system is ready for Wails development!

Need documentation? Run: ^[]8;;https://v3.wails.io/getting-started/your-first-app/^[\wails3 docs^[]8;;^[\
 ♥   If Wails is useful to you or your company, please consider sponsoring the project: ^[]8;;https://github.com/sponsors/leaanthony^[\wails3 sponsor^[]8;;^[\

Checklist:

  • (v2 only) I have updated website/src/pages/changelog.mdx with details of this PR (v3 changelog entries are added automatically)
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the system tray menu property was unavailable until a menu had been set. The property is now present even when no menu is configured, improving consistency for applications that inspect or interact with system tray menus during startup.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 03:14
@github-actions github-actions Bot added Bug Something isn't working v3 labels Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: wailsapp/wails/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54bcd09f-c4fb-42ff-8b5f-d2d5a86a2095
📥 Commits

Reviewing files that changed from the base of the PR and between d8f3336 and 7dea4a0.

📒 Files selected for processing: 1
  • v3/pkg/application/systemtray_linux.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

The Linux system tray property specification now includes the Menu property with the value menuPath, even when no menu is set.

Changes

Linux system tray

Layer / File(s) Summary
Always include the Menu property
v3/pkg/application/systemtray_linux.go
createPropSpec now defines the Menu property as menuPath without checking whether a menu is set.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: leaanthony

Merge Risk: ⚪ Minimal · up to 7dea4

The Menu property is now available before SetMenu, and the referenced dbusmenu object returns an empty layout until a menu is set. No concrete regression to ordinary host interaction is established, so no actionable merge blocker remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed 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 1…
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 identifies the Linux tray fix and the specific behavior change: always advertising the Menu property to prevent trays created after Run from being dropped.
Description check Passed The pull request description is mostly complete. It explains the bug, motivation, implementation, testing, Linux environment, doctor output, and checklist status. It does not provide an issue number a…
Full details: Docstring Coverage

Explanation

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 1 files.

Full details: Description check

Explanation

The pull request description is mostly complete. It explains the bug, motivation, implementation, testing, Linux environment, doctor output, and checklist status. It does not provide an issue number after “Fixes #”, and it explicitly reports that no new unit test was added.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the tray at night
The Menu path is set just right
No menu waits? The field stays there
A steady path through Linux air
The rabbit hops away with care

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow change matches the existing dbusmenu export, with no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes Linux trays created after the application starts being dropped by hosts when no menu is configured yet.

Changes:

  • Always advertises the Menu property, matching the existing unconditional dbusmenu export.
  • Documents why the property must exist before SetMenu.
File Description
v3/​pkg/​application/​systemtray_linux.go Removes the menu-presence guard from the Menu property.

Review effort: Balanced

@leaanthony
leaanthony merged commit 800e5ac into wailsapp:master Oct 27, 2026
45 checks passed
leaanthony pushed a commit that referenced this pull request Oct 27, 2026
… advertise the tray Menu property so a tray created after Run is not dropped
AlbinoGeek added a commit to Rethunk-AI/wails that referenced this pull request Oct 28, 2026
@AlbinoGeek
AlbinoGeek deleted the fix/v3-linux-tray-menu-before-setmenu branch October 28, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Linux v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants