Provide action to switch to the last workspace (#229)

This commit is contained in:
Adam Bieńkowski 2018-05-01 19:59:11 +02:00 committed by Rico Tzschichholz
parent f1a491753a
commit f02b776d95
3 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,7 @@
<value nick="custom-command" value="5" />
<value nick="window-overview" value="6" />
<value nick="window-overview-all" value="7" />
<value nick="switch-to-workspace-last" value="8" />
</enum>
<enum id="GalaWindowOverviewType">
<value nick='grid' value='0'/>

View File

@ -26,7 +26,8 @@ namespace Gala
OPEN_LAUNCHER,
CUSTOM_COMMAND,
WINDOW_OVERVIEW,
WINDOW_OVERVIEW_ALL
WINDOW_OVERVIEW_ALL,
SWITCH_TO_WORKSPACE_LAST
}
/**

View File

@ -684,6 +684,10 @@ namespace Gala
window_overview.open (hints);
}
break;
case ActionType.SWITCH_TO_WORKSPACE_LAST:
var workspace = screen.get_workspace_by_index (screen.get_n_workspaces () - 1);
workspace.activate (display.get_current_time ());
break;
default:
warning ("Trying to run unknown action");
break;