sessionMode: Add hasOverview property
Add a sessionMode.hasOverview property, which determines whether the mode should give access to the overview or not. https://bugzilla.gnome.org/show_bug.cgi?id=676156
This commit is contained in:
parent
19318a1eeb
commit
122bca49ea
@ -142,13 +142,6 @@ function _initUserSession() {
|
|||||||
Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
|
Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
|
||||||
getRunDialog().open();
|
getRunDialog().open();
|
||||||
});
|
});
|
||||||
|
|
||||||
Meta.keybindings_set_custom_handler('panel-main-menu', function () {
|
|
||||||
overview.toggle();
|
|
||||||
});
|
|
||||||
|
|
||||||
global.display.connect('overlay-key', Lang.bind(overview, overview.toggle));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
@ -212,8 +205,7 @@ function start() {
|
|||||||
layoutManager = new Layout.LayoutManager();
|
layoutManager = new Layout.LayoutManager();
|
||||||
xdndHandler = new XdndHandler.XdndHandler();
|
xdndHandler = new XdndHandler.XdndHandler();
|
||||||
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
|
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
|
||||||
// This overview object is just a stub for non-user sessions
|
overview = new Overview.Overview();
|
||||||
overview = new Overview.Overview({ isDummy: sessionMode.sessionType != Shell.SessionType.USER });
|
|
||||||
magnifier = new Magnifier.Magnifier();
|
magnifier = new Magnifier.Magnifier();
|
||||||
statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
|
statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
|
||||||
panel = new Panel.Panel();
|
panel = new Panel.Panel();
|
||||||
@ -236,6 +228,16 @@ function start() {
|
|||||||
|
|
||||||
if (sessionMode.sessionType == Shell.SessionType.USER)
|
if (sessionMode.sessionType == Shell.SessionType.USER)
|
||||||
_initUserSession();
|
_initUserSession();
|
||||||
|
|
||||||
|
if (sessionMode.hasOverview) {
|
||||||
|
Meta.keybindings_set_custom_handler('panel-main-menu', function () {
|
||||||
|
overview.toggle();
|
||||||
|
});
|
||||||
|
|
||||||
|
global.display.connect('overlay-key',
|
||||||
|
Lang.bind(overview, overview.toggle));
|
||||||
|
}
|
||||||
|
|
||||||
statusIconDispatcher.start(messageTray.actor);
|
statusIconDispatcher.start(messageTray.actor);
|
||||||
|
|
||||||
// Provide the bus object for gnome-session to
|
// Provide the bus object for gnome-session to
|
||||||
|
@ -99,10 +99,8 @@ const ShellInfo = new Lang.Class({
|
|||||||
const Overview = new Lang.Class({
|
const Overview = new Lang.Class({
|
||||||
Name: 'Overview',
|
Name: 'Overview',
|
||||||
|
|
||||||
_init : function(params) {
|
_init : function() {
|
||||||
params = Params.parse(params, { isDummy: false });
|
this.isDummy = !Main.sessionMode.hasOverview;
|
||||||
|
|
||||||
this.isDummy = params.isDummy;
|
|
||||||
|
|
||||||
// We only have an overview in user sessions, so
|
// We only have an overview in user sessions, so
|
||||||
// create a dummy overview in other cases
|
// create a dummy overview in other cases
|
||||||
|
@ -962,7 +962,7 @@ const Panel = new Lang.Class({
|
|||||||
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
|
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
|
||||||
|
|
||||||
/* Button on the left side of the panel. */
|
/* Button on the left side of the panel. */
|
||||||
if (Main.sessionMode.sessionType == Shell.SessionType.USER) {
|
if (Main.sessionMode.hasOverview) {
|
||||||
this._activitiesButton = new ActivitiesButton();
|
this._activitiesButton = new ActivitiesButton();
|
||||||
this._activities = this._activitiesButton.actor;
|
this._activities = this._activitiesButton.actor;
|
||||||
this._leftBox.add(this._activities);
|
this._leftBox.add(this._activities);
|
||||||
@ -970,7 +970,9 @@ const Panel = new Lang.Class({
|
|||||||
// The activities button has a pretend menu, so as to integrate
|
// The activities button has a pretend menu, so as to integrate
|
||||||
// more cleanly with the rest of the panel
|
// more cleanly with the rest of the panel
|
||||||
this._menus.addMenu(this._activitiesButton.menu);
|
this._menus.addMenu(this._activitiesButton.menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Main.sessionMode.sessionType == Shell.SessionType.USER) {
|
||||||
this._appMenu = new AppMenuButton(this._menus);
|
this._appMenu = new AppMenuButton(this._menus);
|
||||||
this._leftBox.add(this._appMenu.actor);
|
this._leftBox.add(this._appMenu.actor);
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,11 @@ const Params = imports.misc.params;
|
|||||||
const DEFAULT_MODE = 'user';
|
const DEFAULT_MODE = 'user';
|
||||||
|
|
||||||
const _modes = {
|
const _modes = {
|
||||||
'gdm': { sessionType: Shell.SessionType.GDM },
|
'gdm': { hasOverview: false,
|
||||||
|
sessionType: Shell.SessionType.GDM },
|
||||||
|
|
||||||
'user': { sessionType: Shell.SessionType.USER }
|
'user': { hasOverview: true,
|
||||||
|
sessionType: Shell.SessionType.USER }
|
||||||
};
|
};
|
||||||
|
|
||||||
function modeExists(mode) {
|
function modeExists(mode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user