Skip to content
Merged
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
8 changes: 7 additions & 1 deletion src/Misc/WindowMenuManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ public class Gala.WindowMenuManager : Object {
var window_ws = window.get_workspace ();
var window_ws_index = window_ws.index ();
var n_ws = window.display.get_workspace_manager ().n_workspaces;

/* Always allow move left except on the first one */
var can_move_left = window_ws_index != 0;
var can_move_right = window_ws_index != n_ws - 2 && Utils.get_n_windows (window_ws) != 1;

/* Always allow move right except if we are the only window on
the last not empty workspace (last one is always empty) */
var can_move_right = !(window_ws_index == n_ws - 2 && Utils.get_n_windows (window_ws) == 1);

((SimpleAction) action_group.lookup_action (ACTION_MOVE_LEFT)).set_enabled (can_move_left);
((SimpleAction) action_group.lookup_action (ACTION_MOVE_RIGHT)).set_enabled (can_move_right);

Expand Down