From df51b13098092a6af868ae616aae16cfa8cb0b24 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 2 Sep 2026 22:31:51 +0545 Subject: [PATCH] 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. --- src/window/globalmenu/service.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window/globalmenu/service.py b/src/window/globalmenu/service.py index ecc1696..f31f796 100644 --- a/src/window/globalmenu/service.py +++ b/src/window/globalmenu/service.py @@ -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