sessionMode: Add hasWorkspaces property
Add a sessionMode.hasWorkspaces property, which determines whether the concept of workspaces should be exposed in the interface or not. https://bugzilla.gnome.org/show_bug.cgi?id=676156
This commit is contained in:
parent
5264f39209
commit
ed17418101
@ -133,8 +133,6 @@ function _initRecorder() {
|
|||||||
|
|
||||||
function _initUserSession() {
|
function _initUserSession() {
|
||||||
_initRecorder();
|
_initRecorder();
|
||||||
|
|
||||||
global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, false, -1, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
@ -222,6 +220,10 @@ function start() {
|
|||||||
if (sessionMode.sessionType == Shell.SessionType.USER)
|
if (sessionMode.sessionType == Shell.SessionType.USER)
|
||||||
_initUserSession();
|
_initUserSession();
|
||||||
|
|
||||||
|
if (sessionMode.hasWorkspaces)
|
||||||
|
global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,
|
||||||
|
false, -1, 1);
|
||||||
|
|
||||||
if (sessionMode.allowExtensions) {
|
if (sessionMode.allowExtensions) {
|
||||||
ExtensionSystem.init();
|
ExtensionSystem.init();
|
||||||
ExtensionSystem.loadExtensions();
|
ExtensionSystem.loadExtensions();
|
||||||
@ -590,24 +592,32 @@ function _globalKeyPressHandler(actor, event) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// None of the other bindings are relevant outside of the user's session
|
|
||||||
if (sessionMode.sessionType != Shell.SessionType.USER)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
// left/right would effectively act as synonyms for up/down if we enabled them;
|
// left/right would effectively act as synonyms for up/down if we enabled them;
|
||||||
// but that could be considered confusing; we also disable them in the main view.
|
// but that could be considered confusing; we also disable them in the main view.
|
||||||
//
|
//
|
||||||
// case Meta.KeyBindingAction.WORKSPACE_LEFT:
|
// case Meta.KeyBindingAction.WORKSPACE_LEFT:
|
||||||
|
// if (!sessionMode.hasWorkspaces)
|
||||||
|
// return false;
|
||||||
|
//
|
||||||
// wm.actionMoveWorkspaceLeft();
|
// wm.actionMoveWorkspaceLeft();
|
||||||
// return true;
|
// return true;
|
||||||
// case Meta.KeyBindingAction.WORKSPACE_RIGHT:
|
// case Meta.KeyBindingAction.WORKSPACE_RIGHT:
|
||||||
|
// if (!sessionMode.hasWorkspaces)
|
||||||
|
// return false;
|
||||||
|
//
|
||||||
// wm.actionMoveWorkspaceRight();
|
// wm.actionMoveWorkspaceRight();
|
||||||
// return true;
|
// return true;
|
||||||
case Meta.KeyBindingAction.WORKSPACE_UP:
|
case Meta.KeyBindingAction.WORKSPACE_UP:
|
||||||
|
if (!sessionMode.hasWorkspaces)
|
||||||
|
return false;
|
||||||
|
|
||||||
wm.actionMoveWorkspaceUp();
|
wm.actionMoveWorkspaceUp();
|
||||||
return true;
|
return true;
|
||||||
case Meta.KeyBindingAction.WORKSPACE_DOWN:
|
case Meta.KeyBindingAction.WORKSPACE_DOWN:
|
||||||
|
if (!sessionMode.hasWorkspaces)
|
||||||
|
return false;
|
||||||
|
|
||||||
wm.actionMoveWorkspaceDown();
|
wm.actionMoveWorkspaceDown();
|
||||||
return true;
|
return true;
|
||||||
case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
|
case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
|
||||||
|
@ -15,6 +15,7 @@ const _modes = {
|
|||||||
allowExtensions: false,
|
allowExtensions: false,
|
||||||
allowKeybindingsWhenModal: true,
|
allowKeybindingsWhenModal: true,
|
||||||
hasRunDialog: false,
|
hasRunDialog: false,
|
||||||
|
hasWorkspaces: false,
|
||||||
sessionType: Shell.SessionType.GDM },
|
sessionType: Shell.SessionType.GDM },
|
||||||
|
|
||||||
'user': { hasOverview: true,
|
'user': { hasOverview: true,
|
||||||
@ -24,6 +25,7 @@ const _modes = {
|
|||||||
allowExtensions: true,
|
allowExtensions: true,
|
||||||
allowKeybindingsWhenModal: false,
|
allowKeybindingsWhenModal: false,
|
||||||
hasRunDialog: true,
|
hasRunDialog: true,
|
||||||
|
hasWorkspaces: true,
|
||||||
sessionType: Shell.SessionType.USER }
|
sessionType: Shell.SessionType.USER }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user