Page MenuHomePhabricator

Context menu adds its default actions multiple times
Open, NormalPublic

Description

If the new context menu is added and used multiple times in different views (e.g. DataManagerView and RenderWindowManagerView) the function InitDefaultActions is called multiple times. Since the function accesses the node descriptors as singletons, the default actions are added multiple times to the descriptors and are therefore added multiple times to the context menu.

Event Timeline

kalali triaged this task as Normal priority.Nov 9 2018, 3:41 PM
kalali created this task.

The context menu (taken from the data manager view) also stores it's actions inside a member variable m_DescriptorActionList to later be able to remove the context menu actions from the (global) descriptors if the context menu is destroyed.
So basically we have each action stored inside the global descriptors and inside a local variable.

We could just rely on the local member and wouldn't need to struggle with the global descriptor actions.

However, this leads to the question why the global descriptors (singleton instance) are necessary in the first place. It was probably used to add local actions to the globally accessible node descriptors, e.g. from a custom plugin. So this task is closely related to T19752 and T25583.