windowMenu: Reinstate left/right window movement

The menu items to move a window to the left/right workspaces were
removed when the window menu was implemented in GNOME Shell.  This
is OK for the default vertical layout but not for alternatives.

https://bugzilla.gnome.org/show_bug.cgi?id=751344
This commit is contained in:
Ron Yorston 2015-06-22 22:10:50 +01:00 committed by Jasper St. Pierre
parent 530193a3a2
commit cca528a630

View File

@ -101,13 +101,22 @@ const WindowMenu = new Lang.Class({
if (!isSticky) { if (!isSticky) {
let workspace = window.get_workspace(); let workspace = window.get_workspace();
let idx = workspace.index(); if (workspace != workspace.get_neighbor(Meta.MotionDirection.LEFT)) {
if (idx > 0) { this.addAction(_("Move to Workspace Left"), Lang.bind(this, function(event) {
window.change_workspace(workspace.get_neighbor(Meta.MotionDirection.LEFT));
}));
}
if (workspace != workspace.get_neighbor(Meta.MotionDirection.RIGHT)) {
this.addAction(_("Move to Workspace Right"), Lang.bind(this, function(event) {
window.change_workspace(workspace.get_neighbor(Meta.MotionDirection.RIGHT));
}));
}
if (workspace != workspace.get_neighbor(Meta.MotionDirection.UP)) {
this.addAction(_("Move to Workspace Up"), Lang.bind(this, function(event) { this.addAction(_("Move to Workspace Up"), Lang.bind(this, function(event) {
window.change_workspace(workspace.get_neighbor(Meta.MotionDirection.UP)); window.change_workspace(workspace.get_neighbor(Meta.MotionDirection.UP));
})); }));
} }
if (idx < nWorkspaces) { if (workspace != workspace.get_neighbor(Meta.MotionDirection.DOWN)) {
this.addAction(_("Move to Workspace Down"), Lang.bind(this, function(event) { this.addAction(_("Move to Workspace Down"), Lang.bind(this, function(event) {
window.change_workspace(workspace.get_neighbor(Meta.MotionDirection.DOWN)); window.change_workspace(workspace.get_neighbor(Meta.MotionDirection.DOWN));
})); }));