I start the post illustrating something I didn't know, in order to confirm that I understood correctly, then I ask the consequent question.
Suppose we have a control with an associated popup menu, which is the parent of a control with a different associated popup menu, both set at design time. If at run time the popup menu of the child control is disabled (i.e. the PopupMenu property set to nil), every time the right mouse button is pressed on the child control, the context menu of the parent control is shown. Therefore the possibility of activating the popup menu is not disabled. The attached example shows this mechanism.
If this is confirmed, then I have the following problem. I'm developing a component that can be used as a child of any parent, within a parent-child hierarchy. This control, if in a certain state, uses the right mouse button for a specific function, therefore in that state the popup menu of the control itself must not be active. In this state, to prevent the parent control's popup menu from being shown, should I recursively nil all the ancestors' popup menus, or is there a smarter way to disable the popup?