File tree Expand file tree Collapse file tree 5 files changed +23
-6
lines changed Expand file tree Collapse file tree 5 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -174,12 +174,12 @@ public class Gala.Daemon.WindowMenu : Gtk.Menu {
174174 SignalHandler . unblock (always_on_top, always_on_top_sid);
175175 SignalHandler . unblock (on_visible_workspace, on_visible_workspace_sid);
176176
177- move_right. sensitive = ! on_visible_workspace. active;
177+ move_right. sensitive = ! on_visible_workspace. active && Gala . WindowFlags . ALLOWS_MOVE_RIGHT in flags ;
178178 if (move_right. sensitive) {
179179 move_right_accellabel. accel_string = keybind_settings. get_strv (" move-to-workspace-right" )[0 ];
180180 }
181181
182- move_left. sensitive = ! on_visible_workspace. active;
182+ move_left. sensitive = ! on_visible_workspace. active && Gala . WindowFlags . ALLOWS_MOVE_LEFT in flags ;
183183 if (move_left. sensitive) {
184184 move_left_accellabel. accel_string = keybind_settings. get_strv (" move-to-workspace-left" )[0 ];
185185 }
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ public enum Gala.WindowFlags {
3636 ALWAYS_ON_TOP ,
3737 ON_ALL_WORKSPACES ,
3838 CAN_CLOSE ,
39- IS_TILED
39+ IS_TILED ,
40+ ALLOWS_MOVE_LEFT ,
41+ ALLOWS_MOVE_RIGHT
4042}
4143
4244[DBus (name = " org.pantheon.gala" )]
Original file line number Diff line number Diff line change @@ -200,12 +200,12 @@ public class Gala.Daemon.WindowMenu : Gtk.Popover {
200200 SignalHandler . unblock (always_on_top, always_on_top_sid);
201201 SignalHandler . unblock (on_visible_workspace, on_visible_workspace_sid);
202202
203- move_right. sensitive = ! on_visible_workspace. active;
203+ move_right. sensitive = ! on_visible_workspace. active && Gala . WindowFlags . ALLOWS_MOVE_RIGHT in flags ;
204204 if (move_right. sensitive) {
205205 move_right_accellabel. accel_string = keybind_settings. get_strv (" move-to-workspace-right" )[0 ];
206206 }
207207
208- move_left. sensitive = ! on_visible_workspace. active;
208+ move_left. sensitive = ! on_visible_workspace. active && Gala . WindowFlags . ALLOWS_MOVE_LEFT in flags ;
209209 if (move_left. sensitive) {
210210 move_left_accellabel. accel_string = keybind_settings. get_strv (" move-to-workspace-left" )[0 ];
211211 }
Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ namespace Gala {
5656 ALWAYS_ON_TOP ,
5757 ON_ALL_WORKSPACES ,
5858 CAN_CLOSE ,
59- IS_TILED
59+ IS_TILED ,
60+ ALLOWS_MOVE_LEFT ,
61+ ALLOWS_MOVE_RIGHT
6062 }
6163
6264 /**
Original file line number Diff line number Diff line change @@ -937,6 +937,19 @@ namespace Gala {
937937 if (window. can_close ())
938938 flags |= WindowFlags . CAN_CLOSE ;
939939
940+ unowned var workspace = window. get_workspace ();
941+ if (workspace != null ) {
942+ unowned var manager = window. display. get_workspace_manager ();
943+ var workspace_index = workspace. workspace_index;
944+ if (workspace_index != 0 ) {
945+ flags |= WindowFlags . ALLOWS_MOVE_LEFT ;
946+ }
947+
948+ if (workspace_index != manager. n_workspaces - 2 || Utils . get_n_windows (workspace) != 1 ) {
949+ flags |= WindowFlags . ALLOWS_MOVE_RIGHT ;
950+ }
951+ }
952+
940953 daemon_manager. show_window_menu. begin (flags, x, y);
941954 break ;
942955 case Meta . WindowMenuType . APP:
You can’t perform that action at this time.
0 commit comments