Skip to content

Commit a120189

Browse files
authored
Filter actions in WindowManager.perform_action () (#2741)
We use WindowManager.perform_action () for hot corners and gala-daemon. Currently in main switch workspace corners are available even if ModalProxy disallows them
1 parent 38f0d34 commit a120189

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/WindowManager.vala

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,10 @@ namespace Gala {
785785

786786
switch (type) {
787787
case ActionType.SHOW_MULTITASKING_VIEW:
788+
if (filter_action (MULTITASKING_VIEW)) {
789+
break;
790+
}
791+
788792
if (multitasking_view.is_opened ())
789793
multitasking_view.close ();
790794
else
@@ -847,9 +851,17 @@ namespace Gala {
847851
current.stick ();
848852
break;
849853
case ActionType.SWITCH_TO_WORKSPACE_PREVIOUS:
854+
if (filter_action (SWITCH_WORKSPACE)) {
855+
break;
856+
}
857+
850858
switch_to_next_workspace (Meta.MotionDirection.LEFT, Meta.CURRENT_TIME);
851859
break;
852860
case ActionType.SWITCH_TO_WORKSPACE_NEXT:
861+
if (filter_action (SWITCH_WORKSPACE)) {
862+
break;
863+
}
864+
853865
switch_to_next_workspace (Meta.MotionDirection.RIGHT, Meta.CURRENT_TIME);
854866
break;
855867
case ActionType.MOVE_CURRENT_WORKSPACE_LEFT:
@@ -872,7 +884,7 @@ namespace Gala {
872884
launch_action (ActionKeys.PANEL_MAIN_MENU_ACTION);
873885
break;
874886
case ActionType.WINDOW_OVERVIEW:
875-
if (window_overview == null) {
887+
if (window_overview == null || filter_action (WINDOW_OVERVIEW)) {
876888
break;
877889
}
878890

@@ -884,7 +896,7 @@ namespace Gala {
884896
critical ("Window overview is deprecated");
885897
break;
886898
case ActionType.WINDOW_OVERVIEW_ALL:
887-
if (window_overview == null) {
899+
if (window_overview == null || filter_action (WINDOW_OVERVIEW)) {
888900
break;
889901
}
890902

@@ -895,11 +907,19 @@ namespace Gala {
895907
}
896908
break;
897909
case ActionType.SWITCH_TO_WORKSPACE_LAST:
910+
if (filter_action (SWITCH_WORKSPACE)) {
911+
break;
912+
}
913+
898914
unowned var manager = display.get_workspace_manager ();
899915
unowned var workspace = manager.get_workspace_by_index (manager.get_n_workspaces () - 1);
900916
workspace.activate (display.get_current_time ());
901917
break;
902918
case ActionType.SCREENSHOT_CURRENT:
919+
if (filter_action (SCREENSHOT_WINDOW)) {
920+
break;
921+
}
922+
903923
screenshot_manager.handle_screenshot_current_window_shortcut.begin (false);
904924
break;
905925
default:

0 commit comments

Comments
 (0)