GNOME Bugzilla – Bug 594066
Allow a window manager to inherit keybindings from another window manager
Last modified: 2009-10-29 12:20:30 UTC
Note on patch: this was developed and tested against GNOME 2.26 and then rebase to master. (My gnome-shell test system is still running 2.26 waiting for some video driver fixes in Fedora Rawhide.) There were some trivial conflicts related to the GladeXML => GtkBuilder conversion, so it does need to be checked to make sure it compiles.
Created attachment 142432 [details] [review] Allow a window manager to inherit keybindings from another window manager Mutter shares most (currently all) its keybindings with Metacity, and uses the same /apps/metacity GConf keys. For 2.28, the schemas stay in Metacity; the eventual plan is to have a gnome-wm-data package. This patch allows a window manager to put a _GNOME_WM_KEYBINDINGS property on its _NET_SUPPORTING_WM_CHECK window to provide a comma separated list of window manager names to use for keybinding lookup instead of _NET_WM_NAME.
See bug 594067 for the Mutter part of this and a note about why the same treatment isn't needed for gnome-window-properties.
Not sure if it's a really problem, but the old code seems to be very careful about trapping all X calls while the patch doesn't.
(In reply to comment #3) > Not sure if it's a really problem, but the old code seems to be very careful > about trapping all X calls while the patch doesn't. I don't see that - I factored the internals of: wm_common_get_current_window_manager() into a new function: wm_common_get_window_manager_property() The new function inherits all of the (necessary) error trapping of the old code. And then my code just calls that twice.
I notice + result = wm_common_get_window_manager_property (atom); + if (result) + return result; + else + return g_strdup (WM_COMMON_UNKNOWN); But I don't see the corresponding code in wm_common_get_current_window_manager being removed ? Other than that, patch looks fine to me. As Owen says, all the error trapping is still there.
Forgot about for this for a little bit; now pushed, with the fix that Matthias pointed out. (Thanks!) Attachment 142432 [details] pushed as a01e8da - Allow a window manager to inherit keybindings from another window manager
FWIW, that code was broken. You check for keybindings being NULL in wm-common, but it's never NULL, but set to "Unknown" when the property couldn't be gotten to. See bug 600021.