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

Duplicated Node ID Error #144

Open
scotabroad opened this issue May 5, 2022 · 5 comments
Open

Duplicated Node ID Error #144

scotabroad opened this issue May 5, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@scotabroad
Copy link

scotabroad commented May 5, 2022

Information

  • Operating System: Fedora 35
  • Gnome Shell Version: 41.6
  • Xorg/Wayland?: Wayland
  • Apps tested: Libreoffice Writer
  • Fildem version: 0.6.7

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 scotabroad added the bug Something isn't working label May 5, 2022
@scotabroad
Copy link
Author

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
Copy link
Author

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

@scotabroad
Copy link
Author

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
Copy link

rbreaves commented May 21, 2022

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants