ScreenShield: use LayoutManager for creating the actor
This ensures that the screen shield is created at the right stacking level, so the message tray is visible in the lock screen (showing PAM messages, critical notifications and the on screen keyboard) https://bugzilla.gnome.org/show_bug.cgi?id=619955
This commit is contained in:
parent
c22a00afee
commit
54dc0fd123
@ -40,6 +40,17 @@ const LayoutManager = new Lang.Class({
|
|||||||
this.panelBox.connect('allocation-changed',
|
this.panelBox.connect('allocation-changed',
|
||||||
Lang.bind(this, this._updatePanelBarriers));
|
Lang.bind(this, this._updatePanelBarriers));
|
||||||
|
|
||||||
|
this.screenShieldGroup = new St.Widget({ name: 'screenShieldGroup',
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
// FIXME: This is going to slow everything down by a big factor
|
||||||
|
// Need a better solution (like a layout manager?)
|
||||||
|
let constraint = new Clutter.BindConstraint({ source: global.stage,
|
||||||
|
coordinate: Clutter.BindCoordinate.ALL
|
||||||
|
});
|
||||||
|
this.screenShieldGroup.add_constraint(constraint);
|
||||||
|
this.addChrome(this.screenShieldGroup);
|
||||||
|
|
||||||
this.trayBox = new St.BoxLayout({ name: 'trayBox' });
|
this.trayBox = new St.BoxLayout({ name: 'trayBox' });
|
||||||
this.addChrome(this.trayBox);
|
this.addChrome(this.trayBox);
|
||||||
this.trayBox.connect('allocation-changed',
|
this.trayBox.connect('allocation-changed',
|
||||||
|
@ -29,6 +29,8 @@ const ScreenShield = new Lang.Class({
|
|||||||
Name: 'ScreenShield',
|
Name: 'ScreenShield',
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
|
this.actor = Main.layoutManager.screenShieldGroup;
|
||||||
|
|
||||||
this._presence = new GnomeSession.Presence(Lang.bind(this, function(proxy, error) {
|
this._presence = new GnomeSession.Presence(Lang.bind(this, function(proxy, error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
logError(error, 'Error while reading gnome-session presence');
|
logError(error, 'Error while reading gnome-session presence');
|
||||||
@ -45,18 +47,12 @@ const ScreenShield = new Lang.Class({
|
|||||||
|
|
||||||
this._isModal = false;
|
this._isModal = false;
|
||||||
this._isLocked = false;
|
this._isLocked = false;
|
||||||
this._group = new St.Widget({ x: 0,
|
|
||||||
y: 0 });
|
|
||||||
Main.uiGroup.add_actor(this._group);
|
|
||||||
let constraint = new Clutter.BindConstraint({ source: global.stage,
|
|
||||||
coordinate: Clutter.BindCoordinate.POSITION | Clutter.BindCoordinate.SIZE });
|
|
||||||
this._group.add_constraint(constraint);
|
|
||||||
|
|
||||||
this._lightbox = new Lightbox.Lightbox(this._group,
|
this._lightbox = new Lightbox.Lightbox(Main.uiGroup,
|
||||||
{ inhibitEvents: true, fadeInTime: 10, fadeFactor: 1 });
|
{ inhibitEvents: true, fadeInTime: 10, fadeFactor: 1 });
|
||||||
|
|
||||||
this._background = Meta.BackgroundActor.new_for_screen(global.screen);
|
this._background = Meta.BackgroundActor.new_for_screen(global.screen);
|
||||||
this._background.hide();
|
this.actor.add_actor(this._background);
|
||||||
Main.uiGroup.add_actor(this._background);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onStatusChanged: function(status) {
|
_onStatusChanged: function(status) {
|
||||||
@ -66,9 +62,8 @@ const ScreenShield = new Lang.Class({
|
|||||||
this._dialog = null;
|
this._dialog = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._group.reactive = true;
|
|
||||||
if (!this._isModal) {
|
if (!this._isModal) {
|
||||||
Main.pushModal(this._group);
|
Main.pushModal(this.actor);
|
||||||
this._isModal = true;
|
this._isModal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,10 +83,10 @@ const ScreenShield = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_popModal: function() {
|
_popModal: function() {
|
||||||
this._group.reactive = false;
|
this._lightbox.hide();
|
||||||
Main.popModal(this._group);
|
|
||||||
|
|
||||||
this._background.hide();
|
Main.popModal(this.actor);
|
||||||
|
this.actor.hide();
|
||||||
|
|
||||||
this._isModal = false;
|
this._isModal = false;
|
||||||
this._isLocked = false;
|
this._isLocked = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user