Port preferences to GSettings

Move preferences to GSettings, using mainly shared schemas from
gsettings-desktop-schemas.

Unlike GConf, GSettings support is not optional, as Gio is already
a hard dependency of GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=635378
This commit is contained in:
Florian Müllner
2011-06-24 18:14:15 +02:00
parent a2726f41c9
commit d0910da036
25 changed files with 1024 additions and 2435 deletions

View File

@ -55,12 +55,6 @@
* explain this better)
* or 0 if no flag applies.
*
* 5) a string representing the default binding.
* If this is NULL, the action is unbound by default.
* Please use NULL and not "disabled".
* 6) a short description.
* It must be marked translatable (i.e. inside "_(...)").
*
* Don't try to do XML entity escaping anywhere in the strings.
*/
@ -84,30 +78,18 @@
/* convenience, since in this file they must always be set together */
#define REVERSES_AND_REVERSED (BINDING_REVERSES | BINDING_IS_REVERSED)
keybind (switch_to_workspace_1, handle_switch_to_workspace, 0, 0, NULL,
_("Switch to workspace 1"))
keybind (switch_to_workspace_2, handle_switch_to_workspace, 1, 0, NULL,
_("Switch to workspace 2"))
keybind (switch_to_workspace_3, handle_switch_to_workspace, 2, 0, NULL,
_("Switch to workspace 3"))
keybind (switch_to_workspace_4, handle_switch_to_workspace, 3, 0, NULL,
_("Switch to workspace 4"))
keybind (switch_to_workspace_5, handle_switch_to_workspace, 4, 0, NULL,
_("Switch to workspace 5"))
keybind (switch_to_workspace_6, handle_switch_to_workspace, 5, 0, NULL,
_("Switch to workspace 6"))
keybind (switch_to_workspace_7, handle_switch_to_workspace, 6, 0, NULL,
_("Switch to workspace 7"))
keybind (switch_to_workspace_8, handle_switch_to_workspace, 7, 0, NULL,
_("Switch to workspace 8"))
keybind (switch_to_workspace_9, handle_switch_to_workspace, 8, 0, NULL,
_("Switch to workspace 9"))
keybind (switch_to_workspace_10, handle_switch_to_workspace, 9, 0, NULL,
_("Switch to workspace 10"))
keybind (switch_to_workspace_11, handle_switch_to_workspace, 10, 0, NULL,
_("Switch to workspace 11"))
keybind (switch_to_workspace_12, handle_switch_to_workspace, 11, 0, NULL,
_("Switch to workspace 12"))
keybind (switch-to-workspace-1, handle_switch_to_workspace, 0, 0)
keybind (switch-to-workspace-2, handle_switch_to_workspace, 1, 0)
keybind (switch-to-workspace-3, handle_switch_to_workspace, 2, 0)
keybind (switch-to-workspace-4, handle_switch_to_workspace, 3, 0)
keybind (switch-to-workspace-5, handle_switch_to_workspace, 4, 0)
keybind (switch-to-workspace-6, handle_switch_to_workspace, 5, 0)
keybind (switch-to-workspace-7, handle_switch_to_workspace, 6, 0)
keybind (switch-to-workspace-8, handle_switch_to_workspace, 7, 0)
keybind (switch-to-workspace-9, handle_switch_to_workspace, 8, 0)
keybind (switch-to-workspace-10, handle_switch_to_workspace, 9, 0)
keybind (switch-to-workspace-11, handle_switch_to_workspace, 10, 0)
keybind (switch-to-workspace-12, handle_switch_to_workspace, 11, 0)
/* META_MOTION_* are negative, and so distinct from workspace numbers,
* which are always zero or positive.
@ -117,21 +99,17 @@ keybind (switch_to_workspace_12, handle_switch_to_workspace, 11, 0, NULL,
* workspace.h, of course.
*/
keybind (switch_to_workspace_left, handle_switch_to_workspace,
META_MOTION_LEFT, 0, "<Control><Alt>Left",
_("Switch to workspace on the left of the current workspace"))
keybind (switch-to-workspace-left, handle_switch_to_workspace,
META_MOTION_LEFT, 0)
keybind (switch_to_workspace_right, handle_switch_to_workspace,
META_MOTION_RIGHT, 0, "<Control><Alt>Right",
_("Switch to workspace on the right of the current workspace"))
keybind (switch-to-workspace-right, handle_switch_to_workspace,
META_MOTION_RIGHT, 0)
keybind (switch_to_workspace_up, handle_switch_to_workspace,
META_MOTION_UP, 0, "<Control><Alt>Up",
_("Switch to workspace above the current workspace"))
keybind (switch-to-workspace-up, handle_switch_to_workspace,
META_MOTION_UP, 0)
keybind (switch_to_workspace_down, handle_switch_to_workspace,
META_MOTION_DOWN, 0, "<Control><Alt>Down",
_("Switch to workspace below the current workspace"))
keybind (switch-to-workspace-down, handle_switch_to_workspace,
META_MOTION_DOWN, 0)
/***********************************/
@ -145,45 +123,25 @@ keybind (switch_to_workspace_down, handle_switch_to_workspace,
* same function checking a bit in the parameter for difference.
*/
keybind (switch_group, handle_switch, META_TAB_LIST_GROUP,
BINDING_REVERSES, "<Alt>Above_Tab",
_("Move between windows of an application, using a popup window"))
keybind (switch_group_backward, handle_switch, META_TAB_LIST_GROUP,
REVERSES_AND_REVERSED, NULL,
_("Move backward between windows of an application, "
"using a popup window"))
keybind (switch_windows, handle_switch, META_TAB_LIST_NORMAL,
BINDING_REVERSES, "<Alt>Tab",
_("Move between windows, using a popup window"))
keybind (switch_windows_backward, handle_switch, META_TAB_LIST_NORMAL,
REVERSES_AND_REVERSED, NULL,
_("Move backward between windows, using a popup window"))
keybind (switch_panels, handle_switch, META_TAB_LIST_DOCKS,
BINDING_REVERSES, "<Control><Alt>Tab",
_("Move between panels and the desktop, using a popup window"))
keybind (switch_panels_backward, handle_switch, META_TAB_LIST_DOCKS,
REVERSES_AND_REVERSED, NULL,
_("Move backward between panels and the desktop, "
"using a popup window"))
keybind (switch-group, handle_switch, META_TAB_LIST_GROUP, BINDING_REVERSES)
keybind (switch-group-backward, handle_switch,
META_TAB_LIST_GROUP, REVERSES_AND_REVERSED)
keybind (switch-windows, handle_switch, META_TAB_LIST_NORMAL, BINDING_REVERSES)
keybind (switch-windows-backward, handle_switch, META_TAB_LIST_NORMAL,
REVERSES_AND_REVERSED)
keybind (switch-panels, handle_switch, META_TAB_LIST_DOCKS, BINDING_REVERSES)
keybind (switch-panels-backward, handle_switch, META_TAB_LIST_DOCKS,
REVERSES_AND_REVERSED)
keybind (cycle_group, handle_cycle, META_TAB_LIST_GROUP,
BINDING_REVERSES, "<Alt>F6",
_("Move between windows of an application immediately"))
keybind (cycle_group_backward, handle_cycle, META_TAB_LIST_GROUP,
REVERSES_AND_REVERSED, NULL,
_("Move backward between windows of an application immediately"))
keybind (cycle_windows, handle_cycle, META_TAB_LIST_NORMAL,
BINDING_REVERSES, "<Alt>Escape",
_("Move between windows immediately"))
keybind (cycle_windows_backward, handle_cycle, META_TAB_LIST_NORMAL,
REVERSES_AND_REVERSED, NULL,
_("Move backward between windows immediately"))
keybind (cycle_panels, handle_cycle, META_TAB_LIST_DOCKS,
BINDING_REVERSES, "<Control><Alt>Escape",
_("Move between panels and the desktop immediately"))
keybind (cycle_panels_backward, handle_cycle, META_TAB_LIST_DOCKS,
REVERSES_AND_REVERSED, NULL,
_("Move backward between panels and the desktop immediately"))
keybind (cycle-group, handle_cycle, META_TAB_LIST_GROUP, BINDING_REVERSES)
keybind (cycle-group-backward, handle_cycle, META_TAB_LIST_GROUP,
REVERSES_AND_REVERSED)
keybind (cycle-windows, handle_cycle, META_TAB_LIST_NORMAL, BINDING_REVERSES)
keybind (cycle-windows-backward, handle_cycle, META_TAB_LIST_NORMAL,
REVERSES_AND_REVERSED)
keybind (cycle-panels, handle_cycle, META_TAB_LIST_DOCKS, BINDING_REVERSES)
keybind (cycle-panels-backward, handle_cycle, META_TAB_LIST_DOCKS,
REVERSES_AND_REVERSED)
/***********************************/
@ -192,71 +150,20 @@ keybind (cycle_panels_backward, handle_cycle, META_TAB_LIST_DOCKS,
* grab is in effect, they are invoked for releasing the primary modifier
* or pressing some unbound key, respectively.
*/
keybind (tab_popup_select, handle_tab_popup_select, 0, 0, NULL,
"Select window from tab popup")
keybind (tab_popup_cancel, handle_tab_popup_cancel, 0, 0, NULL,
"Cancel tab popup")
keybind (tab-popup-select, handle_tab_popup_select, 0, 0)
keybind (tab-popup-cancel, handle_tab_popup_cancel, 0, 0)
/***********************************/
keybind (show_desktop, handle_show_desktop, 0, 0, "<Control><Alt>d",
_("Hide all normal windows and set focus to the desktop"))
keybind (panel_main_menu, handle_panel,
META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0, "<Alt>F1",
_("Show the panel's main menu"))
keybind (panel_run_dialog, handle_panel,
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, "<Alt>F2",
_("Show the panel's \"Run Application\" dialog box"))
keybind (toggle_recording, handle_toggle_recording, 0, 0, "<Control><Shift><Alt>r",
_("Start or stop recording the session"))
keybind (show-desktop, handle_show_desktop, 0, 0)
keybind (panel-main-menu, handle_panel,
META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0)
keybind (panel-run-dialog, handle_panel,
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0)
keybind (toggle-recording, handle_toggle_recording, 0, 0)
/* Yes, the param is offset by one. Historical reasons. (Maybe worth fixing
* at some point.) The description is NULL here because the stanza is
* irregularly shaped in mutter.schemas.in. This will probably be fixed
* as well.
*/
keybind (run_command_1, handle_run_command, 0, 0, NULL, NULL)
keybind (run_command_2, handle_run_command, 1, 0, NULL, NULL)
keybind (run_command_3, handle_run_command, 2, 0, NULL, NULL)
keybind (run_command_4, handle_run_command, 3, 0, NULL, NULL)
keybind (run_command_5, handle_run_command, 4, 0, NULL, NULL)
keybind (run_command_6, handle_run_command, 5, 0, NULL, NULL)
keybind (run_command_7, handle_run_command, 6, 0, NULL, NULL)
keybind (run_command_8, handle_run_command, 7, 0, NULL, NULL)
keybind (run_command_9, handle_run_command, 8, 0, NULL, NULL)
keybind (run_command_10, handle_run_command, 9, 0, NULL, NULL)
keybind (run_command_11, handle_run_command, 10, 0, NULL, NULL)
keybind (run_command_12, handle_run_command, 11, 0, NULL, NULL)
keybind (run_command_13, handle_run_command, 12, 0, NULL, NULL)
keybind (run_command_14, handle_run_command, 13, 0, NULL, NULL)
keybind (run_command_15, handle_run_command, 14, 0, NULL, NULL)
keybind (run_command_16, handle_run_command, 15, 0, NULL, NULL)
keybind (run_command_17, handle_run_command, 16, 0, NULL, NULL)
keybind (run_command_18, handle_run_command, 17, 0, NULL, NULL)
keybind (run_command_19, handle_run_command, 18, 0, NULL, NULL)
keybind (run_command_20, handle_run_command, 19, 0, NULL, NULL)
keybind (run_command_21, handle_run_command, 20, 0, NULL, NULL)
keybind (run_command_22, handle_run_command, 21, 0, NULL, NULL)
keybind (run_command_23, handle_run_command, 22, 0, NULL, NULL)
keybind (run_command_24, handle_run_command, 23, 0, NULL, NULL)
keybind (run_command_25, handle_run_command, 24, 0, NULL, NULL)
keybind (run_command_26, handle_run_command, 25, 0, NULL, NULL)
keybind (run_command_27, handle_run_command, 26, 0, NULL, NULL)
keybind (run_command_28, handle_run_command, 27, 0, NULL, NULL)
keybind (run_command_29, handle_run_command, 28, 0, NULL, NULL)
keybind (run_command_30, handle_run_command, 29, 0, NULL, NULL)
keybind (run_command_31, handle_run_command, 30, 0, NULL, NULL)
keybind (run_command_32, handle_run_command, 31, 0, NULL, NULL)
keybind (run_command_screenshot, handle_run_command, 32, 0, "Print",
_("Take a screenshot"))
keybind (run_command_window_screenshot, handle_run_command, 33, 0,"<Alt>Print",
_("Take a screenshot of a window"))
keybind (run_command_terminal, handle_run_terminal, 0, 0, NULL, _("Run a terminal"))
/* No description because this is undocumented */
keybind (set_spew_mark, handle_set_spew_mark, 0, 0, NULL, NULL)
/* FIXME: No description because this is undocumented */
keybind (set-spew-mark, handle_set_spew_mark, 0, 0)
#undef REVERSES_AND_REVERSED
@ -266,70 +173,34 @@ keybind (set_spew_mark, handle_set_spew_mark, 0, 0, NULL, NULL)
* if no window is active.
*/
keybind (activate_window_menu, handle_activate_window_menu, 0,
BINDING_PER_WINDOW, "<Alt>space",
_("Activate the window menu"))
keybind (toggle_fullscreen, handle_toggle_fullscreen, 0, BINDING_PER_WINDOW,
NULL,
_("Toggle fullscreen mode"))
keybind (toggle_maximized, handle_toggle_maximized, 0, BINDING_PER_WINDOW, "<Alt>F10",
_("Toggle maximization state"))
keybind (toggle_above, handle_toggle_above, 0, BINDING_PER_WINDOW, NULL,
_("Toggle whether a window will always be visible over other windows"))
keybind (maximize, handle_maximize, 0, BINDING_PER_WINDOW, NULL,
_("Maximize window"))
keybind (unmaximize, handle_unmaximize, 0, BINDING_PER_WINDOW, "<Alt>F5",
_("Restore window"))
keybind (toggle_shaded, handle_toggle_shaded, 0, BINDING_PER_WINDOW, NULL,
_("Toggle shaded state"))
keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "<Alt>F9",
_("Minimize window"))
keybind (close, handle_close, 0, BINDING_PER_WINDOW, "<Alt>F4",
_("Close window"))
keybind (begin_move, handle_begin_move, 0, BINDING_PER_WINDOW, "<Alt>F7",
_("Move window"))
keybind (begin_resize, handle_begin_resize, 0, BINDING_PER_WINDOW, "<Alt>F8",
_("Resize window"))
keybind (toggle_on_all_workspaces, handle_toggle_on_all_workspaces, 0,
BINDING_PER_WINDOW, NULL,
_("Toggle whether window is on all workspaces or just one"))
keybind (activate-window-menu, handle_activate_window_menu, 0,
BINDING_PER_WINDOW)
keybind (toggle-fullscreen, handle_toggle_fullscreen, 0, BINDING_PER_WINDOW)
keybind (toggle-maximized, handle_toggle_maximized, 0, BINDING_PER_WINDOW)
keybind (toggle-above, handle_toggle_above, 0, BINDING_PER_WINDOW)
keybind (maximize, handle_maximize, 0, BINDING_PER_WINDOW)
keybind (unmaximize, handle_unmaximize, 0, BINDING_PER_WINDOW)
keybind (toggle-shaded, handle_toggle_shaded, 0, BINDING_PER_WINDOW)
keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW)
keybind (close, handle_close, 0, BINDING_PER_WINDOW)
keybind (begin-move, handle_begin_move, 0, BINDING_PER_WINDOW)
keybind (begin-resize, handle_begin_resize, 0, BINDING_PER_WINDOW)
keybind (toggle-on-all-workspaces, handle_toggle_on_all_workspaces, 0,
BINDING_PER_WINDOW)
keybind (move-to-workspace-1, handle_move_to_workspace, 0, BINDING_PER_WINDOW)
keybind (move-to-workspace-2, handle_move_to_workspace, 1, BINDING_PER_WINDOW)
keybind (move-to-workspace-3, handle_move_to_workspace, 2, BINDING_PER_WINDOW)
keybind (move-to-workspace-4, handle_move_to_workspace, 3, BINDING_PER_WINDOW)
keybind (move-to-workspace-5, handle_move_to_workspace, 4, BINDING_PER_WINDOW)
keybind (move-to-workspace-6, handle_move_to_workspace, 5, BINDING_PER_WINDOW)
keybind (move-to-workspace-7, handle_move_to_workspace, 6, BINDING_PER_WINDOW)
keybind (move-to-workspace-8, handle_move_to_workspace, 7, BINDING_PER_WINDOW)
keybind (move-to-workspace-9, handle_move_to_workspace, 8, BINDING_PER_WINDOW)
keybind (move-to-workspace-10, handle_move_to_workspace, 9, BINDING_PER_WINDOW)
keybind (move-to-workspace-11, handle_move_to_workspace, 10, BINDING_PER_WINDOW)
keybind (move-to-workspace-12, handle_move_to_workspace, 11, BINDING_PER_WINDOW)
keybind (move_to_workspace_1, handle_move_to_workspace, 0, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 1"))
keybind (move_to_workspace_2, handle_move_to_workspace, 1, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 2"))
keybind (move_to_workspace_3, handle_move_to_workspace, 2, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 3"))
keybind (move_to_workspace_4, handle_move_to_workspace, 3, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 4"))
keybind (move_to_workspace_5, handle_move_to_workspace, 4, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 5"))
keybind (move_to_workspace_6, handle_move_to_workspace, 5, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 6"))
keybind (move_to_workspace_7, handle_move_to_workspace, 6, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 7"))
keybind (move_to_workspace_8, handle_move_to_workspace, 7, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 8"))
keybind (move_to_workspace_9, handle_move_to_workspace, 8, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 9"))
keybind (move_to_workspace_10, handle_move_to_workspace, 9, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 10"))
keybind (move_to_workspace_11, handle_move_to_workspace, 10, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 11"))
keybind (move_to_workspace_12, handle_move_to_workspace, 11, BINDING_PER_WINDOW,
NULL,
_("Move window to workspace 12"))
/* META_MOTION_* are negative, and so distinct from workspace numbers,
* which are always zero or positive.
@ -339,62 +210,34 @@ keybind (move_to_workspace_12, handle_move_to_workspace, 11, BINDING_PER_WINDOW,
* workspace.h, of course.
*/
keybind (move_to_workspace_left, handle_move_to_workspace,
META_MOTION_LEFT, BINDING_PER_WINDOW, "<Control><Shift><Alt>Left",
_("Move window one workspace to the left"))
keybind (move_to_workspace_right, handle_move_to_workspace,
META_MOTION_RIGHT, BINDING_PER_WINDOW, "<Control><Shift><Alt>Right",
_("Move window one workspace to the right"))
keybind (move_to_workspace_up, handle_move_to_workspace,
META_MOTION_UP, BINDING_PER_WINDOW, "<Control><Shift><Alt>Up",
_("Move window one workspace up"))
keybind (move_to_workspace_down, handle_move_to_workspace,
META_MOTION_DOWN, BINDING_PER_WINDOW, "<Control><Shift><Alt>Down",
_("Move window one workspace down"))
keybind (move-to-workspace-left, handle_move_to_workspace,
META_MOTION_LEFT, BINDING_PER_WINDOW)
keybind (move-to-workspace-right, handle_move_to_workspace,
META_MOTION_RIGHT, BINDING_PER_WINDOW)
keybind (move-to-workspace-up, handle_move_to_workspace,
META_MOTION_UP, BINDING_PER_WINDOW)
keybind (move-to-workspace-down, handle_move_to_workspace,
META_MOTION_DOWN, BINDING_PER_WINDOW)
keybind (raise_or_lower, handle_raise_or_lower, 0, BINDING_PER_WINDOW, NULL,
_("Raise window if it's covered by another window, otherwise lower it"))
keybind (raise, handle_raise, 0, BINDING_PER_WINDOW, NULL,
_("Raise window above other windows"))
keybind (lower, handle_lower, 0, BINDING_PER_WINDOW, NULL,
_("Lower window below other windows"))
keybind (raise-or-lower, handle_raise_or_lower, 0, BINDING_PER_WINDOW)
keybind (raise, handle_raise, 0, BINDING_PER_WINDOW)
keybind (lower, handle_lower, 0, BINDING_PER_WINDOW)
keybind (maximize_vertically, handle_maximize_vertically, 0,
BINDING_PER_WINDOW, NULL,
_("Maximize window vertically"))
keybind (maximize-vertically, handle_maximize_vertically, 0, BINDING_PER_WINDOW)
keybind (maximize_horizontally, handle_maximize_horizontally, 0,
BINDING_PER_WINDOW, NULL,
_("Maximize window horizontally"))
keybind (maximize-horizontally, handle_maximize_horizontally, 0,
BINDING_PER_WINDOW)
keybind (move_to_corner_nw, handle_move_to_corner_nw, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to north-west (top left) corner"))
keybind (move_to_corner_ne, handle_move_to_corner_ne, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to north-east (top right) corner"))
keybind (move_to_corner_sw, handle_move_to_corner_sw, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to south-west (bottom left) corner"))
keybind (move_to_corner_se, handle_move_to_corner_se, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to south-east (bottom right) corner"))
keybind (move-to-corner-nw, handle_move_to_corner_nw, 0, BINDING_PER_WINDOW)
keybind (move-to-corner-ne, handle_move_to_corner_ne, 0, BINDING_PER_WINDOW)
keybind (move-to-corner-sw, handle_move_to_corner_sw, 0, BINDING_PER_WINDOW)
keybind (move-to-corner-se, handle_move_to_corner_se, 0, BINDING_PER_WINDOW)
keybind (move_to_side_n, handle_move_to_side_n, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to north (top) side of screen"))
keybind (move_to_side_s, handle_move_to_side_s, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to south (bottom) side of screen"))
keybind (move_to_side_e, handle_move_to_side_e, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to east (right) side of screen"))
keybind (move_to_side_w, handle_move_to_side_w, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to west (left) side of screen"))
keybind (move_to_center, handle_move_to_center, 0,
BINDING_PER_WINDOW, NULL,
_("Move window to center of screen"))
keybind (move-to-side-n, handle_move_to_side_n, 0, BINDING_PER_WINDOW)
keybind (move-to-side-s, handle_move_to_side_s, 0, BINDING_PER_WINDOW)
keybind (move-to-side-e, handle_move_to_side_e, 0, BINDING_PER_WINDOW)
keybind (move-to-side-w, handle_move_to_side_w, 0, BINDING_PER_WINDOW)
keybind (move-to-center, handle_move_to_center, 0, BINDING_PER_WINDOW)
/* eof all-keybindings.h */

View File

@ -130,7 +130,7 @@ bell_flash_screen (MetaDisplay *display,
XFreeGC (display->xdisplay, gc);
}
if (meta_prefs_get_focus_mode () != META_FOCUS_MODE_CLICK &&
if (meta_prefs_get_focus_mode () != G_DESKTOP_FOCUS_MODE_CLICK &&
!display->mouse_mode)
meta_display_increment_focus_sentinel (display);
XFlush (display->xdisplay);
@ -277,13 +277,13 @@ bell_visual_notify (MetaDisplay *display,
{
switch (meta_prefs_get_visual_bell_type ())
{
case META_VISUAL_BELL_FULLSCREEN_FLASH:
case G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH:
bell_flash_fullscreen (display, xkb_ev);
break;
case META_VISUAL_BELL_FRAME_FLASH:
case G_DESKTOP_VISUAL_BELL_FRAME_FLASH:
bell_flash_frame (display, xkb_ev); /* does nothing yet */
break;
case META_VISUAL_BELL_INVALID:
case G_DESKTOP_VISUAL_BELL_NONE:
/* do nothing */
break;
}
@ -293,9 +293,8 @@ void
meta_bell_notify (MetaDisplay *display,
XkbAnyEvent *xkb_ev)
{
/* flash something */
if (meta_prefs_get_visual_bell ())
bell_visual_notify (display, xkb_ev);
/* flash something if appropriate */
bell_visual_notify (display, xkb_ev);
#ifdef HAVE_LIBCANBERRA
if (meta_prefs_bell_is_audible ())

View File

@ -212,7 +212,7 @@ lower_window_and_transients (MetaWindow *window,
meta_window_foreach_transient (window, lower_window_and_transients, NULL);
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK &&
meta_prefs_get_raise_on_click ())
{
/* Move window to the back of the focusing workspace's MRU list.
@ -538,70 +538,70 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
break;
case META_MENU_OP_UNSTICK:
case META_MENU_OP_STICK:
name = "toggle_on_all_workspaces";
name = "toggle-on-all-workspaces";
break;
case META_MENU_OP_ABOVE:
case META_MENU_OP_UNABOVE:
name = "toggle_above";
name = "toggle-above";
break;
case META_MENU_OP_WORKSPACES:
switch (workspace)
{
case 1:
name = "move_to_workspace_1";
name = "move-to-workspace-1";
break;
case 2:
name = "move_to_workspace_2";
name = "move-to-workspace-2";
break;
case 3:
name = "move_to_workspace_3";
name = "move-to-workspace-3";
break;
case 4:
name = "move_to_workspace_4";
name = "move-to-workspace-4";
break;
case 5:
name = "move_to_workspace_5";
name = "move-to-workspace-5";
break;
case 6:
name = "move_to_workspace_6";
name = "move-to-workspace-6";
break;
case 7:
name = "move_to_workspace_7";
name = "move-to-workspace-7";
break;
case 8:
name = "move_to_workspace_8";
name = "move-to-workspace-8";
break;
case 9:
name = "move_to_workspace_9";
name = "move-to-workspace-9";
break;
case 10:
name = "move_to_workspace_10";
name = "move-to-workspace-10";
break;
case 11:
name = "move_to_workspace_11";
name = "move-to-workspace-11";
break;
case 12:
name = "move_to_workspace_12";
name = "move-to-workspace-12";
break;
}
break;
case META_MENU_OP_MOVE:
name = "begin_move";
name = "begin-move";
break;
case META_MENU_OP_RESIZE:
name = "begin_resize";
name = "begin-resize";
break;
case META_MENU_OP_MOVE_LEFT:
name = "move_to_workspace_left";
name = "move-to-workspace-left";
break;
case META_MENU_OP_MOVE_RIGHT:
name = "move_to_workspace_right";
name = "move-to-workspace-right";
break;
case META_MENU_OP_MOVE_UP:
name = "move_to_workspace_up";
name = "move-to-workspace-up";
break;
case META_MENU_OP_MOVE_DOWN:
name = "move_to_workspace_down";
name = "move-to-workspace-down";
break;
case META_MENU_OP_RECOVER:
/* No keybinding for this one */

View File

@ -1921,7 +1921,7 @@ event_callback (XEvent *event,
* in application-based mode, and the different
* app is not a dock or desktop, eat the focus click.
*/
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK &&
meta_prefs_get_application_based () &&
!window->has_focus &&
window->type != META_WINDOW_DOCK &&
@ -2009,8 +2009,8 @@ event_callback (XEvent *event,
{
switch (meta_prefs_get_focus_mode ())
{
case META_FOCUS_MODE_SLOPPY:
case META_FOCUS_MODE_MOUSE:
case G_DESKTOP_FOCUS_MODE_SLOPPY:
case G_DESKTOP_FOCUS_MODE_MOUSE:
display->mouse_mode = TRUE;
if (window->type != META_WINDOW_DOCK &&
window->type != META_WINDOW_DESKTOP)
@ -2048,7 +2048,7 @@ event_callback (XEvent *event,
* alternative mechanism works great.
*/
if (window->type == META_WINDOW_DESKTOP &&
meta_prefs_get_focus_mode() == META_FOCUS_MODE_MOUSE &&
meta_prefs_get_focus_mode() == G_DESKTOP_FOCUS_MODE_MOUSE &&
display->expected_focus_window != NULL)
{
meta_topic (META_DEBUG_FOCUS,
@ -2060,7 +2060,7 @@ event_callback (XEvent *event,
event->xcrossing.time);
}
break;
case META_FOCUS_MODE_CLICK:
case G_DESKTOP_FOCUS_MODE_CLICK:
break;
}
@ -4003,7 +4003,7 @@ meta_display_grab_focus_window_button (MetaDisplay *display,
* focus window may not be raised, and who wants to think about
* mouse focus anyway.
*/
if (meta_prefs_get_focus_mode () != META_FOCUS_MODE_CLICK)
if (meta_prefs_get_focus_mode () != G_DESKTOP_FOCUS_MODE_CLICK)
{
meta_verbose (" (well, not grabbing since not in click to focus mode)\n");
return;

View File

@ -49,7 +49,7 @@
static gboolean all_bindings_disabled = FALSE;
/* Prototypes for handlers */
#define keybind(name, handler, param, flags, stroke, description) \
#define keybind(name, handler, param, flags) \
static void \
handler (MetaDisplay *display,\
MetaScreen *screen,\
@ -103,7 +103,7 @@ static gboolean process_workspace_switch_grab (MetaDisplay *display,
static void regrab_key_bindings (MetaDisplay *display);
#define keybind(name, handler, param, flags, stroke, description) \
#define keybind(name, handler, param, flags) \
{ #name, handler, handler, param, flags, NULL, NULL },
static MetaKeyHandler key_handlers[] = {
#include "all-keybindings.h"
@ -2183,7 +2183,7 @@ process_tab_grab (MetaDisplay *display,
{
if (end_keyboard_grab (display, event->xkey.keycode))
{
invoke_handler_by_name (display, screen, "tab_popup_select", NULL, event);
invoke_handler_by_name (display, screen, "tab-popup-select", NULL, event);
/* We return FALSE to end the grab; if the handler ended the grab itself
* that will be a noop. If the handler didn't end the grab, then it's a
@ -2239,7 +2239,7 @@ process_tab_grab (MetaDisplay *display,
}
/* Some unhandled key press */
invoke_handler_by_name (display, screen, "tab_popup_cancel", NULL, event);
invoke_handler_by_name (display, screen, "tab-popup-cancel", NULL, event);
return FALSE;
}
@ -2496,138 +2496,6 @@ handle_switch_to_workspace (MetaDisplay *display,
}
}
static void
error_on_command (int command_index,
const char *command,
const char *message,
MetaScreen *screen,
guint32 timestamp)
{
if (command_index < 0)
meta_warning ("Error on terminal command \"%s\": %s\n", command, message);
else
meta_warning ("Error on command %d \"%s\": %s\n",
command_index, command, message);
/*
mutter-dialog said:
FIXME offer to change the value of the command's gconf key
*/
if (command && strcmp(command, "")!=0)
{
char *text = g_strdup_printf (
/* Displayed when a keybinding which is
* supposed to launch a program fails.
*/
_("There was an error running "
"<tt>%s</tt>:\n\n%s"),
command,
message);
meta_show_dialog ("--error",
text,
NULL,
screen->screen_name,
NULL, NULL, 0,
NULL, NULL);
g_free (text);
}
else
{
meta_show_dialog ("--error",
message,
NULL,
screen->screen_name,
NULL, NULL, 0,
NULL, NULL);
}
}
static void
set_display_setup_func (void *data)
{
const char *screen_name = data;
char *full;
full = g_strdup_printf ("DISPLAY=%s", screen_name);
putenv (full);
/* do not free full, because putenv is lame */
}
static gboolean
meta_spawn_command_line_async_on_screen (const gchar *command_line,
MetaScreen *screen,
GError **error)
{
gboolean retval;
gchar **argv = NULL;
g_return_val_if_fail (command_line != NULL, FALSE);
if (!g_shell_parse_argv (command_line,
NULL, &argv,
error))
return FALSE;
retval = g_spawn_async (NULL,
argv,
NULL,
G_SPAWN_SEARCH_PATH,
set_display_setup_func,
screen->screen_name,
NULL,
error);
g_strfreev (argv);
return retval;
}
static void
handle_run_command (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
gint which = binding->handler->data;
const char *command;
GError *err;
command = meta_prefs_get_command (which);
if (command == NULL)
{
char *s;
meta_topic (META_DEBUG_KEYBINDINGS,
"No command %d to run in response to keybinding press\n",
which);
s = g_strdup_printf (_("No command %d has been defined.\n"),
which + 1);
error_on_command (which, NULL, s, screen, event->xkey.time);
g_free (s);
return;
}
err = NULL;
if (!meta_spawn_command_line_async_on_screen (command, screen, &err))
{
error_on_command (which, command, err->message, screen, event->xkey.time);
g_error_free (err);
}
}
static void
handle_maximize_vertically (MetaDisplay *display,
@ -3602,44 +3470,6 @@ meta_set_keybindings_disabled (gboolean setting)
"Keybindings %s\n", all_bindings_disabled ? "disabled" : "enabled");
}
static void
handle_run_terminal (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
const char *command;
GError *err;
command = meta_prefs_get_terminal_command ();
if (command == NULL)
{
char *s;
meta_topic (META_DEBUG_KEYBINDINGS,
"No terminal command to run in response to "
"keybinding press\n");
s = g_strdup_printf (_("No terminal command has been defined.\n"));
error_on_command (-1, NULL, s, screen, event->xkey.time);
g_free (s);
return;
}
err = NULL;
if (!meta_spawn_command_line_async_on_screen (command, screen, &err))
{
error_on_command (-1, command, err->message, screen,
event->xkey.time);
g_error_free (err);
}
}
gboolean
meta_keybindings_set_custom_handler (const gchar *name,
MetaKeyHandlerFunc handler,

File diff suppressed because it is too large Load Diff

View File

@ -1186,7 +1186,7 @@ prefs_changed_callback (MetaPreference pref,
if (pref == META_PREF_NUM_WORKSPACES)
{
/* GConf doesn't provide timestamps, but luckily update_num_workspaces
/* GSettings doesn't provide timestamps, but luckily update_num_workspaces
* often doesn't need it...
*/
guint32 timestamp =

View File

@ -2277,7 +2277,7 @@ idle_calc_showing (gpointer data)
tmp = tmp->next;
}
if (meta_prefs_get_focus_mode () != META_FOCUS_MODE_CLICK)
if (meta_prefs_get_focus_mode () != G_DESKTOP_FOCUS_MODE_CLICK)
{
/* When display->mouse_mode is false, we want to ignore
* EnterNotify events unless they come from mouse motion. To do
@ -2617,7 +2617,7 @@ window_state_on_map (MetaWindow *window,
* approximation to enforce so we do that.
*/
if (*takes_focus &&
meta_prefs_get_focus_new_windows () == META_FOCUS_NEW_WINDOWS_STRICT &&
meta_prefs_get_focus_new_windows () == G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
!window->display->allow_terminal_deactivation &&
__window_is_terminal (window->display->focus_window) &&
!meta_window_is_ancestor_of_transient (window->display->focus_window,
@ -2952,7 +2952,7 @@ meta_window_show (MetaWindow *window)
* that new window below a lot of other windows.
*/
if (overlap ||
(meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
(meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK &&
meta_prefs_get_raise_on_click ()))
meta_window_stack_just_below (window, focus_window);
@ -6836,7 +6836,7 @@ meta_window_notify_focus (MetaWindow *window,
*
* There is dicussion in bugs 102209, 115072, and 461577
*/
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK ||
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK ||
!meta_prefs_get_raise_on_click())
meta_display_ungrab_focus_window_button (window->display, window);
@ -6889,7 +6889,7 @@ meta_window_notify_focus (MetaWindow *window,
meta_window_update_layer (window);
/* Re-grab for click to focus and raise-on-click, if necessary */
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK ||
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK ||
!meta_prefs_get_raise_on_click ())
meta_display_grab_focus_window_button (window->display, window);
}
@ -9867,7 +9867,7 @@ meta_window_set_user_time (MetaWindow *window,
* doesn't want to have focus transferred for now due to new windows.
*/
if (meta_prefs_get_focus_new_windows () ==
META_FOCUS_NEW_WINDOWS_STRICT &&
G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
__window_is_terminal (window))
window->display->allow_terminal_deactivation = FALSE;
}

View File

@ -1201,7 +1201,7 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
}
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK ||
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK ||
!workspace->screen->display->mouse_mode)
focus_ancestor_or_mru_window (workspace, not_this_one, timestamp);
else
@ -1239,9 +1239,9 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
window);
}
}
else if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_SLOPPY)
else if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_SLOPPY)
focus_ancestor_or_mru_window (workspace, not_this_one, timestamp);
else if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_MOUSE)
else if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_MOUSE)
{
meta_topic (META_DEBUG_FOCUS,
"Setting focus to no_focus_window, since no valid "
@ -1300,7 +1300,7 @@ focus_ancestor_or_mru_window (MetaWorkspace *workspace,
meta_window_focus (ancestor, timestamp);
/* Also raise the window if in click-to-focus */
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK)
meta_window_raise (ancestor);
return;
@ -1346,7 +1346,7 @@ focus_ancestor_or_mru_window (MetaWorkspace *workspace,
meta_window_focus (window, timestamp);
/* Also raise the window if in click-to-focus */
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK)
meta_window_raise (window);
}
else