fix(globalmenu): add appmenu-gtk-module root to fast probe

GTK3 apps like nwg-look export their menubar model under
/org/appmenu/gtk/window/menus/menubar/N on unique bus names (:1.x).
The fast probe previously only walked [wm_class, /org/gtk/Application],
missing this path entirely. The full crawl then skips all unique-name
services (svc.startswith(':')), so the menu was never discovered despite
being correctly exported.
This commit is contained in:
sankalp committed 2026-09-02 22:31:51 +05:45
1 parent 7d87bea563
commit df51b13098
1 file changed
+10
+10
View File
@@ -709,6 +709,16 @@ class GlobalMenuService(Service):
if svc_path and GLib.Variant.is_object_path(svc_path):
roots.append(svc_path)
roots.append("/org/gtk/Application")
# GTK3 appmenu-gtk-module exports the menubar model under this root on
# the app's (often unique) bus name, e.g. nwg-look at
# /org/appmenu/gtk/window/menus/menubar/0 on :1.x. Probe it directly so
# such apps are found before the expensive full crawl.
for appmenu_root in (
"/org/appmenu/gtk/window",
"/org/appmenu/gtk/window/menus/menubar",
):
if GLib.Variant.is_object_path(appmenu_root):
roots.append(appmenu_root)
# A freshly-launched app may still be exporting its menubar, so give it
# a longer probe budget; an established app gets the short one. Age is
# taken from the youngest matched service actually in the registry