Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X11 Tooltip exception investigation #2799

Closed
erri120 opened this issue Mar 6, 2025 · 0 comments · Fixed by #2802
Closed

X11 Tooltip exception investigation #2799

erri120 opened this issue Mar 6, 2025 · 0 comments · Fixed by #2802
Assignees
Labels
os-linux This affects Linux related code.

Comments

@erri120
Copy link
Member

erri120 commented Mar 6, 2025

On some Linux systems you get a DBus exception The name is not activatable when hovering over an item that will open a tooltip.

Here are my findings:

Using dbus-monitor we can see the messages being send over DBus. When a tooltip opens, this happens:

method call time=1741258811.468008 sender=:1.142 -> destination=com.canonical.AppMenu.Registrar serial=144 path=/com/canonical/AppMenu/Registrar; interface=com.canonical.AppMenu.Registrar; member=RegisterWindow
   uint32 27263131
   object path "/net/avaloniaui/dbusmenu/db202851e5414c6989c5773735428af5"
error time=1741258811.468016 sender=org.freedesktop.DBus -> destination=:1.142 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=144
   string "The name is not activatable"

The interface that causes the issue is com.canonical.AppMenu.Registrar. The method on that interface RegisterWindow is called by Avalonia X11 for every new window:

https://github.com/AvaloniaUI/Avalonia/blob/603a2bdb43b7e8b2d1c8919f9d0669af7b33f117/src/Avalonia.FreeDesktop/DBusMenuExporter.cs#L110-L122

https://github.com/AvaloniaUI/Avalonia/blob/603a2bdb43b7e8b2d1c8919f9d0669af7b33f117/src/Avalonia.X11/X11Window.cs#L239-L240

The reason we get this for tooltips is because tooltips are implemented as popups, which are implemented as new X11 windows:

https://github.com/AvaloniaUI/Avalonia/blob/603a2bdb43b7e8b2d1c8919f9d0669af7b33f117/src/Avalonia.X11/X11Window.cs#L1221-L1222

As such, when a tooltip opens up, we create a new X11 Window, which tries to register the window on the DBus.

We can either disable DBus native menus or simply don't have tooltips as new X11 windows.

@erri120 erri120 added the os-linux This affects Linux related code. label Mar 6, 2025
@LukeNexusMods LukeNexusMods added this to MVP Mar 6, 2025
@LukeNexusMods LukeNexusMods added the Failed QA Did not pass QA process, required fixes will be in comments label Mar 6, 2025
@erri120 erri120 removed the Failed QA Did not pass QA process, required fixes will be in comments label Mar 6, 2025
@erri120 erri120 self-assigned this Mar 6, 2025
@erri120 erri120 moved this to In Progress in MVP Mar 6, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in MVP Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os-linux This affects Linux related code.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants