This solves the unreleased mnemonic keys.(eg, switching to a non gtk program and alt+x no longer works)
When the plugin is initalized before widget hierarchy is fully initalized, REGULAR_WIDGET quirk was unecessarily reset for several times. More importantly, the global menu context was not set to the newly discovered event window. The situation is encountered when the application first creates a dummy main loop that intializes global menu plugin, then terminate the main loop and set up ui hierarchy. Thanks Michael Arthur for the test case.
It looks like there is a bug which is causing application name not actually being set: (<unknown>:13815): GLib-WARNING **: g_set_prgname() called multiple times
Global settings are the settings that affect the entire desktop. Local settings are the settings that affect the window. They share the same schema, defined in settings.vala Local settings override global settings according to the logic defined in local-settings.vala globalmenu-settings accepts -w commandline argument, to specify the windwo for which the local setting is modifed.
Before this patch we depends on the superriden map function.