screenShield: Move background to Unlock Dialog

In addition to that, remove the ClutterBoxLayout that is set as
the layout manager of the Unlock Dialog, and apply the primary
monitor constraint to the child St.BoxLayout instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872
This commit is contained in:
Georges Basile Stavracas Neto
2019-11-28 19:16:55 -03:00
committed by Florian Müllner
parent 2b39d6e95a
commit 15b59414d6
2 changed files with 52 additions and 41 deletions

View File

@ -4,7 +4,6 @@ const { AccountsService, Clutter, Gio,
GLib, Graphene, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const Background = imports.ui.background;
const GnomeSession = imports.misc.gnomeSession;
const Layout = imports.ui.layout;
const OVirt = imports.gdm.oVirt;
@ -76,15 +75,6 @@ var ScreenShield = class {
this._lockScreenGroup.add_actor(this._lockScreenContents);
this._backgroundGroup = new Clutter.Actor();
this._lockScreenGroup.add_actor(this._backgroundGroup);
this._lockScreenGroup.set_child_below_sibling(this._backgroundGroup, null);
this._bgManagers = [];
this._updateBackgrounds();
Main.layoutManager.connect('monitors-changed', this._updateBackgrounds.bind(this));
this._dragAction = new Clutter.GestureAction();
this._dragAction.connect('gesture-begin', this._onDragBegin.bind(this));
this._dragAction.connect('gesture-progress', this._onDragMotion.bind(this));
@ -190,35 +180,6 @@ var ScreenShield = class {
this._syncInhibitor();
}
_createBackground(monitorIndex) {
let monitor = Main.layoutManager.monitors[monitorIndex];
let widget = new St.Widget({ style_class: 'screen-shield-background',
x: monitor.x,
y: monitor.y,
width: monitor.width,
height: monitor.height });
let bgManager = new Background.BackgroundManager({ container: widget,
monitorIndex,
controlPosition: false,
settingsSchema: SCREENSAVER_SCHEMA });
this._bgManagers.push(bgManager);
this._backgroundGroup.add_child(widget);
}
_updateBackgrounds() {
for (let i = 0; i < this._bgManagers.length; i++)
this._bgManagers[i].destroy();
this._bgManagers = [];
this._backgroundGroup.destroy_all_children();
for (let i = 0; i < Main.layoutManager.monitors.length; i++)
this._createBackground(i);
}
_liftShield(velocity) {
if (this._isLocked) {
if (this._ensureUnlockDialog(true /* allowCancel */))