You are right and I'm sorry for my bad assumption.
I've re-read the thread and maybe now I can answer your initial question.
Where is this menu defined? Is this a compile-time or a run-time configuration item?
The
desktop menu is defined during compile time. By defined during compile time I mean "defined in the code without using any external file", that is, to change the desktop menu one is forced to change the code. You can see how the menu is created
here.
As you have already realized, for what I know, there is now way to recreate those special entries like "Create New", "Bookmarks", "Run ...".
Maybe replacing the middle button action to show one of the custom menus and redefining those custom menus' actions would help (I think this waaas +- you idea in the 2nd post) but that isn't what you wanted initially.