1

Observe:

  1. Open Files/Nautilus.
  2. Right-click on the Files icon in the Dock.
    Result: In the context menu, you see All Windows at the top in its own section, New Window at the top of the next section (followed by a list of folders), either Add to Favorites or Remove from Favorites in the next section, and Quit in the bottom section.
    Note: this content remains intact indefinitely.
  3. Click Add to Favorites if necessary.
  4. Close the Files/Nautilus window.
  5. Right-click the Files shortcut in the Dock/Favorites.
    Result: a similar context menu as before appears, except without the All Windows and Quit sections. See below for a screenshot.
  6. Wait a few seconds.
    Result: all folders disappear from the menu - the only remaining options are New Window and Remove from Favorites.

How do I prevent the folders from disappearing from this context menu?

sample context menu from step 5:

enter image description here

user68186
  • 37,461

1 Answers1

0

You cannot prevent the folders from disappearing from this context menu. Files, i.e., nautilus, must be running for these items to appear on the right-click menu.

Since Files does not anymore control the desktop, it is not anymore running when you closed all windows. That makes the current behavior of the right-click menu inconsistent in the way you observe. That is, however, an issue that needs to be solved at the level of the Ubuntu Dock Gnome Shell extension, which is the software implementing this behavior.

Probably, that behavior should be removed. Instead, "fixed" right-click menu items to quickly access these folders could be added as "Desktop actions" in the .desktop launcher file. Such right-click items, unfortunately, are static, and need to be updated manually.

Note When closing the last windows, it indeed takes several seconds before the nautilus process itself is terminated. That is why you need to wait a few seconds before the items do not anymore appear.

vanadium
  • 97,564