XUL:Menus
From MozillaWiki
Note: This is a planning document - this proposal is not implemented; the plans described here may change.
XUL menus have two significantly different modes of behavior, depending on the platform on which the XUL is being interpreted. On Windows and most X-based *nix platforms, menus are drawn at the top of each window. In this case, the menus specified in the XUL are drawn as styled boxes using gecko layout. On Macintosh operating systems, the menus are drawn by the operating system at the top of the screen: the widget code interprets the XUL menu structure and translates this to an operating system menu. In addition, "document"-style applications on mac do not quit when the last application window closes: instead they maintain a simple menubar at the top of the screen. This menubar should also be available when various dialogs which do not have builtin menus are the topmost window.
The Firefox solution to this dichotomy has been build-time ifdefs, which code a different menu structure for the Macintosh version of the XUL files than for the Windows or Unix version. This solution is poor for XULRunner applications because these applications wish to provide a single application package which is usable on all three platforms. In addition, application authors may not use or own a mac, making macintosh-specific testing impractical.
The long-term solution to this problem will be easier and more maintainable: every XUL application will provide a master menu which will be used by default for all windows; extensions will have a single overlay point for adding new general menu items; a particular window may override this default menu if necessary. By moving this master menu into a location used by both Windows and Mac, it reduces the probability that XUL applications designed primarily on Windows will not work on Mac.
Master menu is formatted as an overlay.
When the master menu is used.
Commands and the master menu (disabling menu items in the proper context).
Cut/copy/paste/undo/redo, XUL widgets, and selections.
