GNOME Bugzilla – Bug 784119
Extension context menus do not refresh even after emit_items_updated_signal is called
Last modified: 2021-06-18 15:53:13 UTC
Hey guys, so I was working on fixing an issue in RabbitVCS (a nautilus-python extension) where our context menu items were not getting refreshed like they used to be. It used to be that you could right-click on a file, return a temporary empty list and in a separate thread generate a menu, then emit the "items-updated" signal and the menu would get refreshed without re-opening the menu. Now, even with the items-updated signal getting passed, and get_file_items getting called again, the menu items don't change until I close and re-open the context menu. I thought it might be due to a bug in nautilus-python, so I wrote up a C extension that reproduces the issue. https://github.com/adamplumb/simple-nautilus-extension To reproduce, open nautilus and right-click on a file. You should see an 'Always here' item. Then, I would expect it to show a 'Sometimes here' item after a second but that doesn't happen. If you close and re-open the menu you'll then see the 'Sometimes here' item. This seems to be a regression because the "items-updated" signal mechanism is still in place, so I would expect it to refresh the menu items in an open context menu.
Are you on a Wayland session? If so, are you able to reproduce the issue on X?
Just tested, that happens in x11 as well, so not Wayland specific. BTW, the given sample code crashes nautilus on third attempt, so there is something wrong in the sample code.
Sorry about that. I've updated the plugin to not crash Nautilus. FYI I just tested on a X11 session and it shows the same behavior as Wayland.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of Files (nautilus), then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/nautilus/-/issues/ Thank you for your understanding and your help.