mate-hud icon indicating copy to clipboard operation
mate-hud copied to clipboard

"Unable to access dbusmenu items."

Open freder opened this issue 4 years ago • 5 comments

hi,

so I wanted to give mate-hud a try, but I can't seem to get it to work:

$ /usr/lib/mate-hud/mate-hud 
Gtk-Message: 15:58:05.384: Failed to load module "appmenu-gtk-module"
INFO:root:Press Alt_R to handle keybinding
INFO:root:Unable to access dbusmenu items.
INFO:root:Unable to access dbusmenu items.
INFO:root:Unable to access dbusmenu items.
INFO:root:Unable to access dbusmenu items.

is all I'm getting.

I'm on mint linux, using cinnamon, so I wasn't sure if it's because mate-hud only works with mate or not.

freder avatar Mar 31 '20 14:03 freder

Same with mate-hud packaged for Debian 11. I don't know if there is a package missing from the dependencies (might be) or if there is a permission / applet issue.

VentGrey avatar Jul 30 '21 03:07 VentGrey

Have you added the following to ~/.profile?

if [ -n "$GTK_MODULES" ]; then
    GTK_MODULES="$GTK_MODULES:unity-gtk-module"
else
    GTK_MODULES="unity-gtk-module"
fi

export GTK_MODULES
export UBUNTU_MENUPROXY=1

This, along with whatever appmenu, dbusmenus, unity-gtk* packages installed in your distro should be sufficient to get mate-hud working (I'm doing this currently in Fedora 34 and it works just fine)

vkareh avatar Jul 30 '21 12:07 vkareh

I'll try adding those to ~/.profile and report back, however there is no unity-gtk-* packages on Debian, only the gir objects and some common libraries, scopes and tools.

VentGrey avatar Jul 30 '21 21:07 VentGrey

Update: tried with both snippet and without the snippet but GTK applications show duplicated menus and the HUD is nowhere to be found.

In both cases I get this error message:

bus.exceptions.DBusException: org.freedesktop.DBus.Error.Failed: error occurred in AboutToShow
Traceback (most recent call last):
  File "/usr/lib/mate-hud/mate-hud", line 472, in hud
    appmenu_success = try_appmenu_interface(int(window_id, 16))
  File "/usr/lib/mate-hud/mate-hud", line 301, in try_appmenu_interface
    expanse_all_menu_with_dbus(dbusmenu_root_item[1], True, "")
  File "/usr/lib/mate-hud/mate-hud", line 279, in expanse_all_menu_with_dbus
    dbusmenu_object_iface.AboutToShow(item_id)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Failed: error occurred in AboutToShow

VentGrey avatar Jul 30 '21 21:07 VentGrey

I also get this on Ubuntu MATE 22.04. And more annoyingly the menu bar becomes hidden for a second. I think the following ticket describes the same issue: https://gitlab.com/vala-panel-project/vala-panel-appmenu/-/issues/196

If I do dbus-send --session --type=method_call --dest=com.canonical.AppMenu.Registrar /com/canonical/AppMenu/Registrar org.freedesktop.DBus.ObjectManager.GetManagedObjects that also hides menu bars but for a few seconds longer.

Simply not calling try_appmenu_interface in /usr/lib/mate-hud/mate-hud fixes it and everything still seems to work so far.

The last error mentioning AboutToShow will be the same as https://github.com/ubuntu-mate/mate-hud/issues/54. Adding a try/except/return around that line helps avoid triggering the error reports at least.

After modifying the code it can be restarted by re-enabling it in mate-tweak. This is just a workaround of course, I don't know what either of these are supposed to do exactly.

balazs-endresz avatar Dec 25 '22 15:12 balazs-endresz