ScreenShield: fix positioning of background with multimonitor
Previously, we would create one StBin per monitor, but each was positioned at 0,0 and sized as the screen, so they would overlap and draw the box shadows on top of the other backgrounds. Instead, we need to size appropriately the bin, and then we need to position the actual MetaBacgroundActor at 0,0, so add a flag to BackgroundManager for this. Also, get rid of MetaBackgroundGroup, they do nothing because the screenshield is not a descendant of the MetaWindowGroup and because the widget in between blocks the propagation of the visible region. At the same time, use a widget, not a bin, because StBin requires you to set .child, not call add_child(). https://bugzilla.gnome.org/show_bug.cgi?id=694394
This commit is contained in:
@ -635,12 +635,14 @@ const BackgroundManager = new Lang.Class({
|
||||
params = Params.parse(params, { container: null,
|
||||
layoutManager: Main.layoutManager,
|
||||
monitorIndex: null,
|
||||
effects: Meta.BackgroundEffects.NONE });
|
||||
effects: Meta.BackgroundEffects.NONE,
|
||||
controlPosition: true });
|
||||
|
||||
this._container = params.container;
|
||||
this._layoutManager = params.layoutManager;
|
||||
this._effects = params.effects;
|
||||
this._monitorIndex = params.monitorIndex;
|
||||
this._controlPosition = params.controlPosition;
|
||||
|
||||
this.background = this._createBackground();
|
||||
this._newBackground = null;
|
||||
@ -700,9 +702,12 @@ const BackgroundManager = new Lang.Class({
|
||||
this._container.add_child(background.actor);
|
||||
|
||||
let monitor = this._layoutManager.monitors[this._monitorIndex];
|
||||
background.actor.set_position(monitor.x, monitor.y);
|
||||
|
||||
background.actor.set_size(monitor.width, monitor.height);
|
||||
background.actor.lower_bottom();
|
||||
if (this._controlPosition) {
|
||||
background.actor.set_position(monitor.x, monitor.y);
|
||||
background.actor.lower_bottom();
|
||||
}
|
||||
|
||||
let signalId = background.connect('changed', Lang.bind(this, function() {
|
||||
background.disconnect(signalId);
|
||||
|
Reference in New Issue
Block a user