Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions daemon-gtk3/WindowMenu.vala
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ public class Gala.Daemon.WindowMenu : Gtk.Menu {
SignalHandler.unblock (always_on_top, always_on_top_sid);
SignalHandler.unblock (on_visible_workspace, on_visible_workspace_sid);

move_right.sensitive = !on_visible_workspace.active;
move_right.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_RIGHT in flags;
if (move_right.sensitive) {
move_right_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-right")[0];
}

move_left.sensitive = !on_visible_workspace.active;
move_left.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_LEFT in flags;
if (move_left.sensitive) {
move_left_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-left")[0];
}
Expand Down
4 changes: 3 additions & 1 deletion daemon/DBus.vala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public enum Gala.WindowFlags {
ALWAYS_ON_TOP,
ON_ALL_WORKSPACES,
CAN_CLOSE,
IS_TILED
IS_TILED,
ALLOWS_MOVE_LEFT,
ALLOWS_MOVE_RIGHT
}

[DBus (name = "org.pantheon.gala")]
Expand Down
4 changes: 2 additions & 2 deletions daemon/WindowMenu.vala
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ public class Gala.Daemon.WindowMenu : Gtk.Popover {
SignalHandler.unblock (always_on_top, always_on_top_sid);
SignalHandler.unblock (on_visible_workspace, on_visible_workspace_sid);

move_right.sensitive = !on_visible_workspace.active;
move_right.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_RIGHT in flags;
if (move_right.sensitive) {
move_right_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-right")[0];
}

move_left.sensitive = !on_visible_workspace.active;
move_left.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_LEFT in flags;
if (move_left.sensitive) {
move_left_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-left")[0];
}
Expand Down
4 changes: 3 additions & 1 deletion lib/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ namespace Gala {
ALWAYS_ON_TOP,
ON_ALL_WORKSPACES,
CAN_CLOSE,
IS_TILED
IS_TILED,
ALLOWS_MOVE_LEFT,
ALLOWS_MOVE_RIGHT
}

/**
Expand Down
13 changes: 13 additions & 0 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,19 @@ namespace Gala {
if (window.can_close ())
flags |= WindowFlags.CAN_CLOSE;

unowned var workspace = window.get_workspace ();
if (workspace != null) {
unowned var manager = window.display.get_workspace_manager ();
var workspace_index = workspace.workspace_index;
if (workspace_index != 0) {
flags |= WindowFlags.ALLOWS_MOVE_LEFT;
}

if (workspace_index != manager.n_workspaces - 2 || Utils.get_n_windows (workspace) != 1) {
flags |= WindowFlags.ALLOWS_MOVE_RIGHT;
}
}

daemon_manager.show_window_menu.begin (flags, x, y);
break;
case Meta.WindowMenuType.APP:
Expand Down
Loading