keybindings: Use a GSettings object rather than a schema, to support extensions

If we want to support keybindings from extensions installed in the user's
directory, we can't take a schema, as the GSettings object needs to have
a special GSettingsSchemaSource.

https://bugzilla.gnome.org/show_bug.cgi?id=673014
This commit is contained in:
Jasper St. Pierre 2012-03-27 11:42:42 -03:00
parent 65390e50a4
commit 68321d9bf4
5 changed files with 113 additions and 110 deletions

View File

@ -29,6 +29,7 @@
#ifndef META_KEYBINDINGS_PRIVATE_H #ifndef META_KEYBINDINGS_PRIVATE_H
#define META_KEYBINDINGS_PRIVATE_H #define META_KEYBINDINGS_PRIVATE_H
#include <gio/gio.h>
#include <meta/keybindings.h> #include <meta/keybindings.h>
struct _MetaKeyHandler struct _MetaKeyHandler
@ -73,7 +74,7 @@ void meta_display_process_mapping_event (MetaDisplay *display,
XEvent *event); XEvent *event);
gboolean meta_prefs_add_keybinding (const char *name, gboolean meta_prefs_add_keybinding (const char *name,
const char *schema, GSettings *settings,
MetaKeyBindingAction action, MetaKeyBindingAction action,
MetaKeyBindingFlags flags); MetaKeyBindingFlags flags);

View File

@ -53,7 +53,7 @@ static gboolean all_bindings_disabled = FALSE;
static gboolean add_builtin_keybinding (MetaDisplay *display, static gboolean add_builtin_keybinding (MetaDisplay *display,
const char *name, const char *name,
const char *schema, GSettings *settings,
MetaKeyBindingFlags flags, MetaKeyBindingFlags flags,
MetaKeyBindingAction action, MetaKeyBindingAction action,
MetaKeyHandlerFunc handler, MetaKeyHandlerFunc handler,
@ -546,7 +546,7 @@ display_get_keybinding (MetaDisplay *display,
static gboolean static gboolean
add_keybinding_internal (MetaDisplay *display, add_keybinding_internal (MetaDisplay *display,
const char *name, const char *name,
const char *schema, GSettings *settings,
MetaKeyBindingFlags flags, MetaKeyBindingFlags flags,
MetaKeyBindingAction action, MetaKeyBindingAction action,
MetaKeyHandlerFunc func, MetaKeyHandlerFunc func,
@ -556,7 +556,7 @@ add_keybinding_internal (MetaDisplay *display,
{ {
MetaKeyHandler *handler; MetaKeyHandler *handler;
if (!meta_prefs_add_keybinding (name, schema, action, flags)) if (!meta_prefs_add_keybinding (name, settings, action, flags))
return FALSE; return FALSE;
handler = g_new0 (MetaKeyHandler, 1); handler = g_new0 (MetaKeyHandler, 1);
@ -576,13 +576,13 @@ add_keybinding_internal (MetaDisplay *display,
static gboolean static gboolean
add_builtin_keybinding (MetaDisplay *display, add_builtin_keybinding (MetaDisplay *display,
const char *name, const char *name,
const char *schema, GSettings *settings,
MetaKeyBindingFlags flags, MetaKeyBindingFlags flags,
MetaKeyBindingAction action, MetaKeyBindingAction action,
MetaKeyHandlerFunc handler, MetaKeyHandlerFunc handler,
int handler_arg) int handler_arg)
{ {
return add_keybinding_internal (display, name, schema, return add_keybinding_internal (display, name, settings,
flags | META_KEY_BINDING_BUILTIN, flags | META_KEY_BINDING_BUILTIN,
action, handler, handler_arg, NULL, NULL); action, handler, handler_arg, NULL, NULL);
} }
@ -591,7 +591,7 @@ add_builtin_keybinding (MetaDisplay *display,
* meta_display_add_keybinding: * meta_display_add_keybinding:
* @display: a #MetaDisplay * @display: a #MetaDisplay
* @name: the binding's name * @name: the binding's name
* @schema: the #GSettings schema where @name is stored * @settings: the #GSettings object where @name is stored
* @flags: flags to specify binding details * @flags: flags to specify binding details
* @handler: function to run when the keybinding is invoked * @handler: function to run when the keybinding is invoked
* @user_data: the data to pass to @handler * @user_data: the data to pass to @handler
@ -617,13 +617,13 @@ add_builtin_keybinding (MetaDisplay *display,
gboolean gboolean
meta_display_add_keybinding (MetaDisplay *display, meta_display_add_keybinding (MetaDisplay *display,
const char *name, const char *name,
const char *schema, GSettings *settings,
MetaKeyBindingFlags flags, MetaKeyBindingFlags flags,
MetaKeyHandlerFunc handler, MetaKeyHandlerFunc handler,
gpointer user_data, gpointer user_data,
GDestroyNotify free_data) GDestroyNotify free_data)
{ {
return add_keybinding_internal (display, name, schema, flags, return add_keybinding_internal (display, name, settings, flags,
META_KEYBINDING_ACTION_NONE, META_KEYBINDING_ACTION_NONE,
handler, 0, user_data, free_data); handler, 0, user_data, free_data);
} }
@ -3644,104 +3644,106 @@ init_builtin_key_bindings (MetaDisplay *display)
{ {
#define REVERSES_AND_REVERSED (META_KEY_BINDING_REVERSES | \ #define REVERSES_AND_REVERSED (META_KEY_BINDING_REVERSES | \
META_KEY_BINDING_IS_REVERSED) META_KEY_BINDING_IS_REVERSED)
GSettings *common_keybindings = g_settings_new (SCHEMA_COMMON_KEYBINDINGS);
GSettings *mutter_keybindings = g_settings_new (SCHEMA_MUTTER_KEYBINDINGS);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-1", "switch-to-workspace-1",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_1, META_KEYBINDING_ACTION_WORKSPACE_1,
handle_switch_to_workspace, 0); handle_switch_to_workspace, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-2", "switch-to-workspace-2",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_2, META_KEYBINDING_ACTION_WORKSPACE_2,
handle_switch_to_workspace, 1); handle_switch_to_workspace, 1);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-3", "switch-to-workspace-3",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_3, META_KEYBINDING_ACTION_WORKSPACE_3,
handle_switch_to_workspace, 2); handle_switch_to_workspace, 2);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-4", "switch-to-workspace-4",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_4, META_KEYBINDING_ACTION_WORKSPACE_4,
handle_switch_to_workspace, 3); handle_switch_to_workspace, 3);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-5", "switch-to-workspace-5",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_5, META_KEYBINDING_ACTION_WORKSPACE_5,
handle_switch_to_workspace, 4); handle_switch_to_workspace, 4);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-6", "switch-to-workspace-6",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_6, META_KEYBINDING_ACTION_WORKSPACE_6,
handle_switch_to_workspace, 5); handle_switch_to_workspace, 5);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-7", "switch-to-workspace-7",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_7, META_KEYBINDING_ACTION_WORKSPACE_7,
handle_switch_to_workspace, 6); handle_switch_to_workspace, 6);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-8", "switch-to-workspace-8",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_8, META_KEYBINDING_ACTION_WORKSPACE_8,
handle_switch_to_workspace, 7); handle_switch_to_workspace, 7);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-9", "switch-to-workspace-9",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_9, META_KEYBINDING_ACTION_WORKSPACE_9,
handle_switch_to_workspace, 8); handle_switch_to_workspace, 8);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-10", "switch-to-workspace-10",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_10, META_KEYBINDING_ACTION_WORKSPACE_10,
handle_switch_to_workspace, 9); handle_switch_to_workspace, 9);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-11", "switch-to-workspace-11",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_11, META_KEYBINDING_ACTION_WORKSPACE_11,
handle_switch_to_workspace, 10); handle_switch_to_workspace, 10);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-12", "switch-to-workspace-12",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_12, META_KEYBINDING_ACTION_WORKSPACE_12,
handle_switch_to_workspace, 11); handle_switch_to_workspace, 11);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-left", "switch-to-workspace-left",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_LEFT, META_KEYBINDING_ACTION_WORKSPACE_LEFT,
handle_switch_to_workspace, META_MOTION_LEFT); handle_switch_to_workspace, META_MOTION_LEFT);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-right", "switch-to-workspace-right",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_RIGHT, META_KEYBINDING_ACTION_WORKSPACE_RIGHT,
handle_switch_to_workspace, META_MOTION_RIGHT); handle_switch_to_workspace, META_MOTION_RIGHT);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-up", "switch-to-workspace-up",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_UP, META_KEYBINDING_ACTION_WORKSPACE_UP,
handle_switch_to_workspace, META_MOTION_UP); handle_switch_to_workspace, META_MOTION_UP);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-to-workspace-down", "switch-to-workspace-down",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_WORKSPACE_DOWN, META_KEYBINDING_ACTION_WORKSPACE_DOWN,
handle_switch_to_workspace, META_MOTION_DOWN); handle_switch_to_workspace, META_MOTION_DOWN);
@ -3759,84 +3761,84 @@ init_builtin_key_bindings (MetaDisplay *display)
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-group", "switch-group",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_REVERSES, META_KEY_BINDING_REVERSES,
META_KEYBINDING_ACTION_SWITCH_GROUP, META_KEYBINDING_ACTION_SWITCH_GROUP,
handle_switch, META_TAB_LIST_GROUP); handle_switch, META_TAB_LIST_GROUP);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-group-backward", "switch-group-backward",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
REVERSES_AND_REVERSED, REVERSES_AND_REVERSED,
META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD, META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD,
handle_switch, META_TAB_LIST_GROUP); handle_switch, META_TAB_LIST_GROUP);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-windows", "switch-windows",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_REVERSES, META_KEY_BINDING_REVERSES,
META_KEYBINDING_ACTION_SWITCH_WINDOWS, META_KEYBINDING_ACTION_SWITCH_WINDOWS,
handle_switch, META_TAB_LIST_NORMAL); handle_switch, META_TAB_LIST_NORMAL);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-windows-backward", "switch-windows-backward",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
REVERSES_AND_REVERSED, REVERSES_AND_REVERSED,
META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD, META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD,
handle_switch, META_TAB_LIST_NORMAL); handle_switch, META_TAB_LIST_NORMAL);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-panels", "switch-panels",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_REVERSES, META_KEY_BINDING_REVERSES,
META_KEYBINDING_ACTION_SWITCH_PANELS, META_KEYBINDING_ACTION_SWITCH_PANELS,
handle_switch, META_TAB_LIST_DOCKS); handle_switch, META_TAB_LIST_DOCKS);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-panels-backward", "switch-panels-backward",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
REVERSES_AND_REVERSED, REVERSES_AND_REVERSED,
META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD, META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD,
handle_switch, META_TAB_LIST_DOCKS); handle_switch, META_TAB_LIST_DOCKS);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"cycle-group", "cycle-group",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_REVERSES, META_KEY_BINDING_REVERSES,
META_KEYBINDING_ACTION_CYCLE_GROUP, META_KEYBINDING_ACTION_CYCLE_GROUP,
handle_cycle, META_TAB_LIST_GROUP); handle_cycle, META_TAB_LIST_GROUP);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"cycle-group-backward", "cycle-group-backward",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
REVERSES_AND_REVERSED, REVERSES_AND_REVERSED,
META_KEYBINDING_ACTION_CYCLE_GROUP_BACKWARD, META_KEYBINDING_ACTION_CYCLE_GROUP_BACKWARD,
handle_cycle, META_TAB_LIST_GROUP); handle_cycle, META_TAB_LIST_GROUP);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"cycle-windows", "cycle-windows",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_REVERSES, META_KEY_BINDING_REVERSES,
META_KEYBINDING_ACTION_CYCLE_WINDOWS, META_KEYBINDING_ACTION_CYCLE_WINDOWS,
handle_cycle, META_TAB_LIST_NORMAL); handle_cycle, META_TAB_LIST_NORMAL);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"cycle-windows-backward", "cycle-windows-backward",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
REVERSES_AND_REVERSED, REVERSES_AND_REVERSED,
META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD, META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD,
handle_cycle, META_TAB_LIST_NORMAL); handle_cycle, META_TAB_LIST_NORMAL);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"cycle-panels", "cycle-panels",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_REVERSES, META_KEY_BINDING_REVERSES,
META_KEYBINDING_ACTION_CYCLE_PANELS, META_KEYBINDING_ACTION_CYCLE_PANELS,
handle_cycle, META_TAB_LIST_DOCKS); handle_cycle, META_TAB_LIST_DOCKS);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"cycle-panels-backward", "cycle-panels-backward",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
REVERSES_AND_REVERSED, REVERSES_AND_REVERSED,
META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD, META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD,
handle_cycle, META_TAB_LIST_DOCKS); handle_cycle, META_TAB_LIST_DOCKS);
@ -3849,14 +3851,14 @@ init_builtin_key_bindings (MetaDisplay *display)
*/ */
add_builtin_keybinding (display, add_builtin_keybinding (display,
"tab-popup-select", "tab-popup-select",
SCHEMA_MUTTER_KEYBINDINGS, mutter_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_TAB_POPUP_SELECT, META_KEYBINDING_ACTION_TAB_POPUP_SELECT,
handle_tab_popup_select, 0); handle_tab_popup_select, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"tab-popup-cancel", "tab-popup-cancel",
SCHEMA_MUTTER_KEYBINDINGS, mutter_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_TAB_POPUP_CANCEL, META_KEYBINDING_ACTION_TAB_POPUP_CANCEL,
handle_tab_popup_cancel, 0); handle_tab_popup_cancel, 0);
@ -3865,35 +3867,35 @@ init_builtin_key_bindings (MetaDisplay *display)
add_builtin_keybinding (display, add_builtin_keybinding (display,
"show-desktop", "show-desktop",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_SHOW_DESKTOP, META_KEYBINDING_ACTION_SHOW_DESKTOP,
handle_show_desktop, 0); handle_show_desktop, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"panel-main-menu", "panel-main-menu",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_PANEL_MAIN_MENU, META_KEYBINDING_ACTION_PANEL_MAIN_MENU,
handle_panel, META_KEYBINDING_ACTION_PANEL_MAIN_MENU); handle_panel, META_KEYBINDING_ACTION_PANEL_MAIN_MENU);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"panel-run-dialog", "panel-run-dialog",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, META_KEYBINDING_ACTION_PANEL_RUN_DIALOG,
handle_panel, META_KEYBINDING_ACTION_PANEL_RUN_DIALOG); handle_panel, META_KEYBINDING_ACTION_PANEL_RUN_DIALOG);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-recording", "toggle-recording",
SCHEMA_MUTTER_KEYBINDINGS, mutter_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_TOGGLE_RECORDING, META_KEYBINDING_ACTION_TOGGLE_RECORDING,
handle_toggle_recording, 0); handle_toggle_recording, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"set-spew-mark", "set-spew-mark",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_NONE, META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_SET_SPEW_MARK, META_KEYBINDING_ACTION_SET_SPEW_MARK,
handle_set_spew_mark, 0); handle_set_spew_mark, 0);
@ -3908,311 +3910,314 @@ init_builtin_key_bindings (MetaDisplay *display)
add_builtin_keybinding (display, add_builtin_keybinding (display,
"activate-window-menu", "activate-window-menu",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_ACTIVATE_WINDOW_MENU, META_KEYBINDING_ACTION_ACTIVATE_WINDOW_MENU,
handle_activate_window_menu, 0); handle_activate_window_menu, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-fullscreen", "toggle-fullscreen",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_FULLSCREEN, META_KEYBINDING_ACTION_TOGGLE_FULLSCREEN,
handle_toggle_fullscreen, 0); handle_toggle_fullscreen, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-maximized", "toggle-maximized",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_MAXIMIZED, META_KEYBINDING_ACTION_TOGGLE_MAXIMIZED,
handle_toggle_maximized, 0); handle_toggle_maximized, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-tiled-left", "toggle-tiled-left",
SCHEMA_MUTTER_KEYBINDINGS, mutter_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_TILED_LEFT, META_KEYBINDING_ACTION_TOGGLE_TILED_LEFT,
handle_toggle_tiled, META_TILE_LEFT); handle_toggle_tiled, META_TILE_LEFT);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-tiled-right", "toggle-tiled-right",
SCHEMA_MUTTER_KEYBINDINGS, mutter_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_TILED_RIGHT, META_KEYBINDING_ACTION_TOGGLE_TILED_RIGHT,
handle_toggle_tiled, META_TILE_RIGHT); handle_toggle_tiled, META_TILE_RIGHT);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-above", "toggle-above",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_ABOVE, META_KEYBINDING_ACTION_TOGGLE_ABOVE,
handle_toggle_above, 0); handle_toggle_above, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"maximize", "maximize",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MAXIMIZE, META_KEYBINDING_ACTION_MAXIMIZE,
handle_maximize, 0); handle_maximize, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"unmaximize", "unmaximize",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_UNMAXIMIZE, META_KEYBINDING_ACTION_UNMAXIMIZE,
handle_unmaximize, 0); handle_unmaximize, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-shaded", "toggle-shaded",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_SHADED, META_KEYBINDING_ACTION_TOGGLE_SHADED,
handle_toggle_shaded, 0); handle_toggle_shaded, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"minimize", "minimize",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MINIMIZE, META_KEYBINDING_ACTION_MINIMIZE,
handle_minimize, 0); handle_minimize, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"close", "close",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_CLOSE, META_KEYBINDING_ACTION_CLOSE,
handle_close, 0); handle_close, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"begin-move", "begin-move",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_BEGIN_MOVE, META_KEYBINDING_ACTION_BEGIN_MOVE,
handle_begin_move, 0); handle_begin_move, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"begin-resize", "begin-resize",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_BEGIN_RESIZE, META_KEYBINDING_ACTION_BEGIN_RESIZE,
handle_begin_resize, 0); handle_begin_resize, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"toggle-on-all-workspaces", "toggle-on-all-workspaces",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_ON_ALL_WORKSPACES, META_KEYBINDING_ACTION_TOGGLE_ON_ALL_WORKSPACES,
handle_toggle_on_all_workspaces, 0); handle_toggle_on_all_workspaces, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-1", "move-to-workspace-1",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_1, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_1,
handle_move_to_workspace, 0); handle_move_to_workspace, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-2", "move-to-workspace-2",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_2, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_2,
handle_move_to_workspace, 1); handle_move_to_workspace, 1);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-3", "move-to-workspace-3",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_3, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_3,
handle_move_to_workspace, 2); handle_move_to_workspace, 2);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-4", "move-to-workspace-4",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_4, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_4,
handle_move_to_workspace, 3); handle_move_to_workspace, 3);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-5", "move-to-workspace-5",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_5, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_5,
handle_move_to_workspace, 4); handle_move_to_workspace, 4);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-6", "move-to-workspace-6",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_6, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_6,
handle_move_to_workspace, 5); handle_move_to_workspace, 5);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-7", "move-to-workspace-7",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_7, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_7,
handle_move_to_workspace, 6); handle_move_to_workspace, 6);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-8", "move-to-workspace-8",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_8, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_8,
handle_move_to_workspace, 7); handle_move_to_workspace, 7);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-9", "move-to-workspace-9",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_9, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_9,
handle_move_to_workspace, 8); handle_move_to_workspace, 8);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-10", "move-to-workspace-10",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_10, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_10,
handle_move_to_workspace, 9); handle_move_to_workspace, 9);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-11", "move-to-workspace-11",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_11, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_11,
handle_move_to_workspace, 10); handle_move_to_workspace, 10);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-12", "move-to-workspace-12",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_12, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_12,
handle_move_to_workspace, 11); handle_move_to_workspace, 11);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-left", "move-to-workspace-left",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_LEFT, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_LEFT,
handle_move_to_workspace, META_MOTION_LEFT); handle_move_to_workspace, META_MOTION_LEFT);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-right", "move-to-workspace-right",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_RIGHT, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_RIGHT,
handle_move_to_workspace, META_MOTION_RIGHT); handle_move_to_workspace, META_MOTION_RIGHT);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-up", "move-to-workspace-up",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_UP, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_UP,
handle_move_to_workspace, META_MOTION_UP); handle_move_to_workspace, META_MOTION_UP);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-workspace-down", "move-to-workspace-down",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_DOWN, META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_DOWN,
handle_move_to_workspace, META_MOTION_DOWN); handle_move_to_workspace, META_MOTION_DOWN);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"raise-or-lower", "raise-or-lower",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_RAISE_OR_LOWER, META_KEYBINDING_ACTION_RAISE_OR_LOWER,
handle_raise_or_lower, 0); handle_raise_or_lower, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"raise", "raise",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_RAISE, META_KEYBINDING_ACTION_RAISE,
handle_raise, 0); handle_raise, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"lower", "lower",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_LOWER, META_KEYBINDING_ACTION_LOWER,
handle_lower, 0); handle_lower, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"maximize-vertically", "maximize-vertically",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY, META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY,
handle_maximize_vertically, 0); handle_maximize_vertically, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"maximize-horizontally", "maximize-horizontally",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY, META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY,
handle_maximize_horizontally, 0); handle_maximize_horizontally, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-corner-nw", "move-to-corner-nw",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW, META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW,
handle_move_to_corner_nw, 0); handle_move_to_corner_nw, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-corner-ne", "move-to-corner-ne",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE, META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE,
handle_move_to_corner_ne, 0); handle_move_to_corner_ne, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-corner-sw", "move-to-corner-sw",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_CORNER_SW, META_KEYBINDING_ACTION_MOVE_TO_CORNER_SW,
handle_move_to_corner_sw, 0); handle_move_to_corner_sw, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-corner-se", "move-to-corner-se",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_CORNER_SE, META_KEYBINDING_ACTION_MOVE_TO_CORNER_SE,
handle_move_to_corner_se, 0); handle_move_to_corner_se, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-side-n", "move-to-side-n",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_SIDE_N, META_KEYBINDING_ACTION_MOVE_TO_SIDE_N,
handle_move_to_side_n, 0); handle_move_to_side_n, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-side-s", "move-to-side-s",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_SIDE_S, META_KEYBINDING_ACTION_MOVE_TO_SIDE_S,
handle_move_to_side_s, 0); handle_move_to_side_s, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-side-e", "move-to-side-e",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_SIDE_E, META_KEYBINDING_ACTION_MOVE_TO_SIDE_E,
handle_move_to_side_e, 0); handle_move_to_side_e, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-side-w", "move-to-side-w",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_SIDE_W, META_KEYBINDING_ACTION_MOVE_TO_SIDE_W,
handle_move_to_side_w, 0); handle_move_to_side_w, 0);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"move-to-center", "move-to-center",
SCHEMA_COMMON_KEYBINDINGS, common_keybindings,
META_KEY_BINDING_PER_WINDOW, META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_CENTER, META_KEYBINDING_ACTION_MOVE_TO_CENTER,
handle_move_to_center, 0); handle_move_to_center, 0);
g_object_unref (common_keybindings);
g_object_unref (mutter_keybindings);
} }
void void

View File

@ -1660,7 +1660,7 @@ meta_key_pref_free (MetaKeyPref *pref)
update_binding (pref, NULL); update_binding (pref, NULL);
g_free (pref->name); g_free (pref->name);
g_free (pref->schema); g_object_unref (pref->settings);
g_free (pref); g_free (pref);
} }
@ -1920,13 +1920,13 @@ meta_prefs_get_visual_bell_type (void)
gboolean gboolean
meta_prefs_add_keybinding (const char *name, meta_prefs_add_keybinding (const char *name,
const char *schema, GSettings *settings,
MetaKeyBindingAction action, MetaKeyBindingAction action,
MetaKeyBindingFlags flags) MetaKeyBindingFlags flags)
{ {
MetaKeyPref *pref; MetaKeyPref *pref;
GSettings *settings;
char **strokes; char **strokes;
guint id;
if (g_hash_table_lookup (key_bindings, name)) if (g_hash_table_lookup (key_bindings, name))
{ {
@ -1934,19 +1934,9 @@ meta_prefs_add_keybinding (const char *name,
return FALSE; return FALSE;
} }
settings = SETTINGS (schema);
if (settings == NULL)
{
settings = g_settings_new (schema);
if ((flags & META_KEY_BINDING_BUILTIN) != 0)
g_signal_connect (settings, "changed",
G_CALLBACK (bindings_changed), NULL);
g_hash_table_insert (settings_schemas, g_strdup (schema), settings);
}
pref = g_new0 (MetaKeyPref, 1); pref = g_new0 (MetaKeyPref, 1);
pref->name = g_strdup (name); pref->name = g_strdup (name);
pref->schema = g_strdup (schema); pref->settings = g_object_ref (settings);
pref->action = action; pref->action = action;
pref->bindings = NULL; pref->bindings = NULL;
pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0; pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0;
@ -1959,9 +1949,17 @@ meta_prefs_add_keybinding (const char *name,
g_hash_table_insert (key_bindings, g_strdup (name), pref); g_hash_table_insert (key_bindings, g_strdup (name), pref);
if (!pref->builtin) if (pref->builtin)
{
if (g_object_get_data (G_OBJECT (settings), "changed-signal") == NULL)
{
id = g_signal_connect (settings, "changed",
G_CALLBACK (bindings_changed), NULL);
g_object_set_data (G_OBJECT (settings), "changed-signal", GUINT_TO_POINTER (id));
}
}
else
{ {
guint id;
char *changed_signal = g_strdup_printf ("changed::%s", name); char *changed_signal = g_strdup_printf ("changed::%s", name);
id = g_signal_connect (settings, changed_signal, id = g_signal_connect (settings, changed_signal,
G_CALLBACK (bindings_changed), NULL); G_CALLBACK (bindings_changed), NULL);
@ -1979,7 +1977,6 @@ gboolean
meta_prefs_remove_keybinding (const char *name) meta_prefs_remove_keybinding (const char *name)
{ {
MetaKeyPref *pref; MetaKeyPref *pref;
GSettings *settings;
guint id; guint id;
pref = g_hash_table_lookup (key_bindings, name); pref = g_hash_table_lookup (key_bindings, name);
@ -1995,9 +1992,8 @@ meta_prefs_remove_keybinding (const char *name)
return FALSE; return FALSE;
} }
settings = SETTINGS (pref->schema); id = GPOINTER_TO_UINT (g_object_steal_data (G_OBJECT (pref->settings), name));
id = GPOINTER_TO_UINT (g_object_steal_data (G_OBJECT (settings), name)); g_signal_handler_disconnect (pref->settings, id);
g_signal_handler_disconnect (settings, id);
g_hash_table_remove (key_bindings, name); g_hash_table_remove (key_bindings, name);

View File

@ -129,7 +129,7 @@ MetaGrabOp meta_display_get_grab_op (MetaDisplay *display);
gboolean meta_display_add_keybinding (MetaDisplay *display, gboolean meta_display_add_keybinding (MetaDisplay *display,
const char *name, const char *name,
const char *schema, GSettings *settings,
MetaKeyBindingFlags flags, MetaKeyBindingFlags flags,
MetaKeyHandlerFunc handler, MetaKeyHandlerFunc handler,
gpointer user_data, gpointer user_data,

View File

@ -30,6 +30,7 @@
#include <meta/types.h> #include <meta/types.h>
#include <pango/pango-font.h> #include <pango/pango-font.h>
#include <gdesktop-enums.h> #include <gdesktop-enums.h>
#include <gio/gio.h>
/* Keep in sync with GSettings schemas! */ /* Keep in sync with GSettings schemas! */
typedef enum typedef enum
@ -271,7 +272,7 @@ typedef struct _MetaKeyHandler MetaKeyHandler;
typedef struct typedef struct
{ {
char *name; char *name;
char *schema; GSettings *settings;
MetaKeyBindingAction action; MetaKeyBindingAction action;