diff --git a/data/org.gnome.mutter.gschema.xml.in b/data/org.gnome.mutter.gschema.xml.in index 703817864..4ced07f13 100644 --- a/data/org.gnome.mutter.gschema.xml.in +++ b/data/org.gnome.mutter.gschema.xml.in @@ -156,6 +156,11 @@ Cancel tab popup + + p','XF86Display']]]> + Switch monitor configurations + + Rotates the built-in monitor configuration diff --git a/src/core/keybindings.c b/src/core/keybindings.c index c7e3c8869..518416ce2 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -3328,6 +3328,27 @@ handle_switch_vt (MetaDisplay *display, } #endif /* HAVE_NATIVE_BACKEND */ +static void +handle_switch_monitor (MetaDisplay *display, + MetaScreen *screen, + MetaWindow *window, + ClutterKeyEvent *event, + MetaKeyBinding *binding, + gpointer dummy) +{ + MetaBackend *backend = meta_get_backend (); + MetaMonitorManager *monitor_manager = + meta_backend_get_monitor_manager (backend); + MetaMonitorSwitchConfigType config_type = + meta_monitor_manager_get_switch_config (monitor_manager); + + if (!meta_monitor_manager_can_switch_config (monitor_manager)) + return; + + config_type = (config_type + 1) % (META_MONITOR_SWITCH_CONFIG_UNKNOWN); + meta_monitor_manager_switch_config (monitor_manager, config_type); +} + static void handle_rotate_monitor (MetaDisplay *display, MetaScreen *screen, @@ -3632,6 +3653,13 @@ init_builtin_key_bindings (MetaDisplay *display) META_KEYBINDING_ACTION_SET_SPEW_MARK, handle_set_spew_mark, 0); + add_builtin_keybinding (display, + "switch-monitor", + mutter_keybindings, + META_KEY_BINDING_NONE, + META_KEYBINDING_ACTION_SWITCH_MONITOR, + handle_switch_monitor, 0); + add_builtin_keybinding (display, "rotate-monitor", mutter_keybindings, diff --git a/src/meta/prefs.h b/src/meta/prefs.h index 961d5abc3..a0175aea9 100644 --- a/src/meta/prefs.h +++ b/src/meta/prefs.h @@ -357,6 +357,7 @@ typedef enum _MetaKeyBindingAction META_KEYBINDING_ACTION_OVERLAY_KEY, META_KEYBINDING_ACTION_ISO_NEXT_GROUP, META_KEYBINDING_ACTION_ALWAYS_ON_TOP, + META_KEYBINDING_ACTION_SWITCH_MONITOR, META_KEYBINDING_ACTION_ROTATE_MONITOR, META_KEYBINDING_ACTION_LAST