diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 7918a7c60..bd557baa3 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -41,6 +41,7 @@
#include "ui.h"
#include "frame.h"
#include "place.h"
+#include "screen-private.h"
#include
#include
@@ -3973,6 +3974,26 @@ handle_move_to_workspace (MetaDisplay *display,
}
}
+static void
+handle_move_to_monitor (MetaDisplay *display,
+ MetaScreen *screen,
+ MetaWindow *window,
+ XIDeviceEvent *event,
+ MetaKeyBinding *binding,
+ gpointer dummy)
+{
+ gint which = binding->handler->data;
+ const MetaMonitorInfo *current, *new;
+
+ current = meta_screen_get_monitor_for_window (screen, window);
+ new = meta_screen_get_monitor_neighbor (screen, current->number, which);
+
+ if (new == NULL)
+ return;
+
+ meta_window_move_to_monitor (window, new->number);
+}
+
static void
handle_raise_or_lower (MetaDisplay *display,
MetaScreen *screen,
@@ -4629,6 +4650,34 @@ init_builtin_key_bindings (MetaDisplay *display)
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_DOWN,
handle_move_to_workspace, META_MOTION_DOWN);
+ add_builtin_keybinding (display,
+ "move-to-monitor-left",
+ common_keybindings,
+ META_KEY_BINDING_PER_WINDOW,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT,
+ handle_move_to_monitor, META_SCREEN_LEFT);
+
+ add_builtin_keybinding (display,
+ "move-to-monitor-right",
+ common_keybindings,
+ META_KEY_BINDING_PER_WINDOW,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT,
+ handle_move_to_monitor, META_SCREEN_RIGHT);
+
+ add_builtin_keybinding (display,
+ "move-to-monitor-down",
+ common_keybindings,
+ META_KEY_BINDING_PER_WINDOW,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN,
+ handle_move_to_monitor, META_SCREEN_DOWN);
+
+ add_builtin_keybinding (display,
+ "move-to-monitor-up",
+ common_keybindings,
+ META_KEY_BINDING_PER_WINDOW,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP,
+ handle_move_to_monitor, META_SCREEN_UP);
+
add_builtin_keybinding (display,
"raise-or-lower",
common_keybindings,
diff --git a/src/meta/prefs.h b/src/meta/prefs.h
index fabe3525d..248d16cc8 100644
--- a/src/meta/prefs.h
+++ b/src/meta/prefs.h
@@ -243,6 +243,10 @@ void meta_prefs_set_ignore_request_hide_titlebar (gboolean whether);
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_RIGHT: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_UP: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_DOWN: FILLME
+ * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT: FILLME
+ * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT: FILLME
+ * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP: FILLME
+ * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN: FILLME
* @META_KEYBINDING_ACTION_RAISE_OR_LOWER: FILLME
* @META_KEYBINDING_ACTION_RAISE: FILLME
* @META_KEYBINDING_ACTION_LOWER: FILLME
@@ -336,6 +340,10 @@ typedef enum _MetaKeyBindingAction
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_RIGHT,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_UP,
META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_DOWN,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP,
+ META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN,
META_KEYBINDING_ACTION_RAISE_OR_LOWER,
META_KEYBINDING_ACTION_RAISE,
META_KEYBINDING_ACTION_LOWER,