gonzaarcr / Fildem

Fildem global menu
GNU General Public License v3.0
799 stars 83 forks source link

Duplicated Node ID Error #144

Open scotabroad opened 2 years ago

scotabroad commented 2 years ago

Information

What is the current behavior?

I have installed the extension and the file from Github. Wanting to make sure Fildem works before I configure it to start on startup, I run it in my terminal. When I open Libreoffice Writer, the menu does not appear at the top. I have disabled all other extensions. Below is my terminal output:

ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/dbus/connection.py", line 232, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/utils/window.py", line 155, in _window_switched
    cls._call_all_listeners(win)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/utils/window.py", line 160, in _call_all_listeners
    callback(window)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/utils/menu.py", line 39, in on_window_switched
    self._init_window()
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/utils/menu.py", line 34, in _init_window
    self._update()
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/utils/menu.py", line 122, in _update
    self._update_menus()
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/utils/menu.py", line 114, in _update_menus
    self._menu_model._update_menus()
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/menu_model/menu_model.py", line 318, in _update_menus
    self.gtkmenu.get_results()
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/menu_model/menu_model.py", line 70, in get_results
    self.collect_entries(treelib_parent='Root')
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/menu_model/menu_model.py", line 98, in collect_entries
    self.collect_entries(menu[':section'], labels, treelib_parent)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/menu_model/menu_model.py", line 98, in collect_entries
    self.collect_entries(menu[':section'], labels, treelib_parent)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/menu_model/menu_model.py", line 93, in collect_entries
    self.collect_entries(menu[':submenu'], menu_path, menu_item.action)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/menu_model/menu_model.py", line 98, in collect_entries
    self.collect_entries(menu[':section'], labels, treelib_parent)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/menu_model/menu_model.py", line 90, in collect_entries
    self.tree.create_node(menu_item.label, menu_item.action, treelib_parent, data=menu_item)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/treelib/tree.py", line 345, in create_node
    self.add_node(node, parent)
  File "/usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg/fildem/treelib/tree.py", line 268, in add_node
    raise DuplicatedNodeIdError("Can't create node "
fildem.treelib.exceptions.DuplicatedNodeIdError: Can't create node with ID ''

Steps to reproduce the problem

Install the extension Install the file Run sudo python3 setup.py install --optimize=1 Configure ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings.ini Logout and Reboot Open terminal to run fildem Open Libreoffice Writer

What is the expected behavior?

Global menu should be exported to topbar and be visible.

scotabroad commented 2 years ago

By commenting out lines if node.identifier in self._nodes: raise DuplicatedNodeIdError("Can't create node " "with ID '%s'" % node.identifier) in fildem/treelib/tree.py, I can finally get the global menu to display, though I can't interact with it for LibreOffice. It should be noted that the menu for Chromium also now appears (previously it didn't). That one can be interacted with.

scotabroad commented 2 years ago

Okay, Chromium only works on Xorg, not Wayland. LibreOffice still doesn't work.

scotabroad commented 2 years ago

It seems having a small screen negatively impacts this. The menu only works if I shrink my screen scaling from 200% to 100%. Otherwise, some menu items appear as dots.

rbreaves commented 2 years ago

Same issue here with Fedora 36 - although I can't figure out how to modify the egg file properly to apply this work around. /usr/local/lib/python3.10/site-packages/fildem-0.6.7-py3.10.egg

Issue exists under x11 for me, I have not tested wayland and don't care to. Also had to set selinux to permissive to even make it this far.

Ok - now I got it to show a menu but yea I cannot interact with it..

circonfl3x commented 1 year ago

Same issue with Arch Linux + Gnome 42 (42.4).

App menu appears in firefox-appmenu, chromium, vscode but doesn't appear in libreoffice for some reason with the same error message.