boxpointer: Call set_allocation before allocating child

It's important to update the allocation of the parent before allocating
its children, it's an assumption we make in a lot of places.

This broke resource scale calculation for boxpointers and their
children when multiple monitors with different scales are used and the
primary monitor is not positioned at x=0, y=0.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1615
This commit is contained in:
Jonas Dreßler 2020-03-10 11:05:13 +01:00 committed by Florian Müllner
parent c00d79bae2
commit 63a0e521fd

View File

@ -197,6 +197,11 @@ var BoxPointer = GObject.registerClass({
} }
vfunc_allocate(box, flags) { vfunc_allocate(box, flags) {
if (this._sourceActor && this._sourceActor.mapped) {
this._reposition(box);
this._updateFlip(box);
}
this.set_allocation(box, flags); this.set_allocation(box, flags);
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
@ -230,12 +235,6 @@ var BoxPointer = GObject.registerClass({
break; break;
} }
this.bin.allocate(childBox, flags); this.bin.allocate(childBox, flags);
if (this._sourceActor && this._sourceActor.mapped) {
this._reposition(box);
this._updateFlip(box);
this.set_allocation(box, flags);
}
} }
_drawBorder(area) { _drawBorder(area) {