Remove ClutterAllocationFlags

Those flags were removed from Clutter since they're pretty much unused,
so remove them here, too.

See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1245
This commit is contained in:
Jonas Dreßler 2020-05-09 21:30:26 +02:00
parent 693dd79d28
commit 9b99b67fea
34 changed files with 142 additions and 160 deletions

View File

@ -589,8 +589,8 @@ var LoginDialog = GObject.registerClass({
return actorBox; return actorBox;
} }
vfunc_allocate(dialogBox, flags) { vfunc_allocate(dialogBox) {
this.set_allocation(dialogBox, flags); this.set_allocation(dialogBox);
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
dialogBox = themeNode.get_content_box(dialogBox); dialogBox = themeNode.get_content_box(dialogBox);
@ -719,19 +719,19 @@ var LoginDialog = GObject.registerClass({
// Finally hand out the allocations // Finally hand out the allocations
if (bannerAllocation) if (bannerAllocation)
this._bannerView.allocate(bannerAllocation, flags); this._bannerView.allocate(bannerAllocation);
if (authPromptAllocation) if (authPromptAllocation)
this._authPrompt.allocate(authPromptAllocation, flags); this._authPrompt.allocate(authPromptAllocation);
if (userSelectionAllocation) if (userSelectionAllocation)
this._userSelectionBox.allocate(userSelectionAllocation, flags); this._userSelectionBox.allocate(userSelectionAllocation);
if (logoAllocation) if (logoAllocation)
this._logoBin.allocate(logoAllocation, flags); this._logoBin.allocate(logoAllocation);
if (sessionMenuButtonAllocation) if (sessionMenuButtonAllocation)
this._sessionMenuButton.allocate(sessionMenuButtonAllocation, flags); this._sessionMenuButton.allocate(sessionMenuButtonAllocation);
} }
_ensureUserListLoaded() { _ensureUserListLoaded() {

View File

@ -68,8 +68,8 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
this._items = this._switcherList.icons; this._items = this._switcherList.icons;
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
super.vfunc_allocate(box, flags); super.vfunc_allocate(box);
// Allocate the thumbnails // Allocate the thumbnails
// We try to avoid overflowing the screen so we base the resulting size on // We try to avoid overflowing the screen so we base the resulting size on
@ -102,7 +102,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
this._thumbnails.addClones(primary.y + primary.height - bottomPadding - childBox.y1); this._thumbnails.addClones(primary.y + primary.height - bottomPadding - childBox.y1);
let [, childNaturalHeight] = this._thumbnails.get_preferred_height(-1); let [, childNaturalHeight] = this._thumbnails.get_preferred_height(-1);
childBox.y2 = childBox.y1 + childNaturalHeight; childBox.y2 = childBox.y1 + childNaturalHeight;
this._thumbnails.allocate(childBox, flags); this._thumbnails.allocate(childBox);
} }
} }
@ -749,9 +749,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
return super.vfunc_get_preferred_height(forWidth); return super.vfunc_get_preferred_height(forWidth);
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
// Allocate the main list items // Allocate the main list items
super.vfunc_allocate(box, flags); super.vfunc_allocate(box);
let contentBox = this.get_theme_node().get_content_box(box); let contentBox = this.get_theme_node().get_content_box(box);
@ -766,7 +766,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
childBox.x2 = childBox.x1 + arrowWidth; childBox.x2 = childBox.x1 + arrowWidth;
childBox.y1 = contentBox.y1 + itemBox.y2 + arrowHeight; childBox.y1 = contentBox.y1 + itemBox.y2 + arrowHeight;
childBox.y2 = childBox.y1 + arrowHeight; childBox.y2 = childBox.y1 + arrowHeight;
this._arrows[i].allocate(childBox, flags); this._arrows[i].allocate(childBox);
} }
} }
@ -1056,7 +1056,7 @@ class WindowSwitcher extends SwitcherPopup.SwitcherList {
return [minHeight, natHeight]; return [minHeight, natHeight];
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
let contentBox = themeNode.get_content_box(box); let contentBox = themeNode.get_content_box(box);
const labelHeight = this._label.height; const labelHeight = this._label.height;
@ -1064,20 +1064,20 @@ class WindowSwitcher extends SwitcherPopup.SwitcherList {
labelHeight + themeNode.get_padding(St.Side.BOTTOM); labelHeight + themeNode.get_padding(St.Side.BOTTOM);
box.y2 -= totalLabelHeight; box.y2 -= totalLabelHeight;
super.vfunc_allocate(box, flags); super.vfunc_allocate(box);
// Hooking up the parent vfunc will call this.set_allocation() with // Hooking up the parent vfunc will call this.set_allocation() with
// the height without the label height, so call it again with the // the height without the label height, so call it again with the
// correct size here. // correct size here.
box.y2 += totalLabelHeight; box.y2 += totalLabelHeight;
this.set_allocation(box, flags); this.set_allocation(box);
const childBox = new Clutter.ActorBox(); const childBox = new Clutter.ActorBox();
childBox.x1 = contentBox.x1; childBox.x1 = contentBox.x1;
childBox.x2 = contentBox.x2; childBox.x2 = contentBox.x2;
childBox.y2 = contentBox.y2; childBox.y2 = contentBox.y2;
childBox.y1 = childBox.y2 - labelHeight; childBox.y1 = childBox.y2 - labelHeight;
this._label.allocate(childBox, flags); this._label.allocate(childBox);
} }
highlight(index, justOutline) { highlight(index, justOutline) {

View File

@ -1071,13 +1071,13 @@ var ViewStackLayout = GObject.registerClass({
Signals: { 'allocated-size-changed': { param_types: [GObject.TYPE_INT, Signals: { 'allocated-size-changed': { param_types: [GObject.TYPE_INT,
GObject.TYPE_INT] } }, GObject.TYPE_INT] } },
}, class ViewStackLayout extends Clutter.BinLayout { }, class ViewStackLayout extends Clutter.BinLayout {
vfunc_allocate(actor, box, flags) { vfunc_allocate(actor, box) {
let availWidth = box.x2 - box.x1; let availWidth = box.x2 - box.x1;
let availHeight = box.y2 - box.y1; let availHeight = box.y2 - box.y1;
// Prepare children of all views for the upcoming allocation, calculate all // Prepare children of all views for the upcoming allocation, calculate all
// the needed values to adapt available size // the needed values to adapt available size
this.emit('allocated-size-changed', availWidth, availHeight); this.emit('allocated-size-changed', availWidth, availHeight);
super.vfunc_allocate(actor, box, flags); super.vfunc_allocate(actor, box);
} }
}); });
@ -1947,7 +1947,7 @@ var AppFolderDialog = GObject.registerClass({
} }
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
let contentBox = this.get_theme_node().get_content_box(box); let contentBox = this.get_theme_node().get_content_box(box);
contentBox = this._viewBox.get_theme_node().get_content_box(contentBox); contentBox = this._viewBox.get_theme_node().get_content_box(contentBox);
@ -1960,7 +1960,7 @@ var AppFolderDialog = GObject.registerClass({
this._view._grid.topPadding = 0; this._view._grid.topPadding = 0;
super.vfunc_allocate(box, flags); super.vfunc_allocate(box);
// We can only start zooming after receiving an allocation // We can only start zooming after receiving an allocation
if (this._needsZoomAndFade) if (this._needsZoomAndFade)

View File

@ -196,13 +196,13 @@ var BoxPointer = GObject.registerClass({
return themeNode.adjust_preferred_height(...height); return themeNode.adjust_preferred_height(...height);
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
if (this._sourceActor && this._sourceActor.mapped) { if (this._sourceActor && this._sourceActor.mapped) {
this._reposition(box); this._reposition(box);
this._updateFlip(box); this._updateFlip(box);
} }
this.set_allocation(box, flags); this.set_allocation(box);
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
let borderWidth = themeNode.get_length('-arrow-border-width'); let borderWidth = themeNode.get_length('-arrow-border-width');
@ -214,7 +214,7 @@ var BoxPointer = GObject.registerClass({
childBox.y1 = 0; childBox.y1 = 0;
childBox.x2 = availWidth; childBox.x2 = availWidth;
childBox.y2 = availHeight; childBox.y2 = availHeight;
this._border.allocate(childBox, flags); this._border.allocate(childBox);
childBox.x1 = borderWidth; childBox.x1 = borderWidth;
childBox.y1 = borderWidth; childBox.y1 = borderWidth;
@ -234,7 +234,7 @@ var BoxPointer = GObject.registerClass({
childBox.x2 -= rise; childBox.x2 -= rise;
break; break;
} }
this.bin.allocate(childBox, flags); this.bin.allocate(childBox);
} }
_drawBorder(area) { _drawBorder(area) {

View File

@ -292,11 +292,11 @@ class DashActor extends St.Widget {
}); });
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
let contentBox = this.get_theme_node().get_content_box(box); let contentBox = this.get_theme_node().get_content_box(box);
let availWidth = contentBox.x2 - contentBox.x1; let availWidth = contentBox.x2 - contentBox.x1;
this.set_allocation(box, flags); this.set_allocation(box);
let [appIcons, showAppsButton] = this.get_children(); let [appIcons, showAppsButton] = this.get_children();
let [, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth); let [, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth);
@ -306,11 +306,11 @@ class DashActor extends St.Widget {
childBox.y1 = contentBox.y1; childBox.y1 = contentBox.y1;
childBox.x2 = contentBox.x2; childBox.x2 = contentBox.x2;
childBox.y2 = contentBox.y2 - showAppsNatHeight; childBox.y2 = contentBox.y2 - showAppsNatHeight;
appIcons.allocate(childBox, flags); appIcons.allocate(childBox);
childBox.y1 = contentBox.y2 - showAppsNatHeight; childBox.y1 = contentBox.y2 - showAppsNatHeight;
childBox.y2 = contentBox.y2; childBox.y2 = contentBox.y2;
showAppsButton.allocate(childBox, flags); showAppsButton.allocate(childBox);
} }
vfunc_get_preferred_height(forWidth) { vfunc_get_preferred_height(forWidth) {

View File

@ -565,8 +565,8 @@ class FreezableBinLayout extends Clutter.BinLayout {
return this._savedHeight; return this._savedHeight;
} }
vfunc_allocate(container, allocation, flags) { vfunc_allocate(container, allocation) {
super.vfunc_allocate(container, allocation, flags); super.vfunc_allocate(container, allocation);
let [width, height] = allocation.get_size(); let [width, height] = allocation.get_size();
this._savedWidth = [width, width]; this._savedWidth = [width, width];

View File

@ -197,9 +197,9 @@ function zoomOutActorAtPos(actor, x, y) {
}); });
} }
function animateIconPosition(icon, box, flags, nChangedIcons) { function animateIconPosition(icon, box, nChangedIcons) {
if (!icon.has_allocation() || icon.allocation.equal(box) || icon.opacity === 0) { if (!icon.has_allocation() || icon.allocation.equal(box) || icon.opacity === 0) {
icon.allocate(box, flags); icon.allocate(box);
return false; return false;
} }
@ -207,7 +207,7 @@ function animateIconPosition(icon, box, flags, nChangedIcons) {
icon.set_easing_mode(Clutter.AnimationMode.EASE_OUT_QUAD); icon.set_easing_mode(Clutter.AnimationMode.EASE_OUT_QUAD);
icon.set_easing_delay(nChangedIcons * ICON_POSITION_DELAY); icon.set_easing_delay(nChangedIcons * ICON_POSITION_DELAY);
icon.allocate(box, flags); icon.allocate(box);
icon.restore_easing_state(); icon.restore_easing_state();
@ -350,8 +350,8 @@ var IconGrid = GObject.registerClass({
return themeNode.adjust_preferred_height(height, height); return themeNode.adjust_preferred_height(height, height);
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
box = themeNode.get_content_box(box); box = themeNode.get_content_box(box);
@ -397,7 +397,7 @@ var IconGrid = GObject.registerClass({
if (!animating) if (!animating)
children[i].opacity = 255; children[i].opacity = 255;
if (animateIconPosition(children[i], childBox, flags, nChangedIcons)) if (animateIconPosition(children[i], childBox, nChangedIcons))
nChangedIcons++; nChangedIcons++;
} }
@ -855,11 +855,11 @@ class PaginatedIconGrid extends IconGrid {
return [height, height]; return [height, height];
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
if (this._childrenPerPage == 0) if (this._childrenPerPage == 0)
log('computePages() must be called before allocate(); pagination will not work.'); log('computePages() must be called before allocate(); pagination will not work.');
this.set_allocation(box, flags); this.set_allocation(box);
if (this._fillParent) { if (this._fillParent) {
// Reset the passed in box to fill the parent // Reset the passed in box to fill the parent
@ -892,7 +892,7 @@ class PaginatedIconGrid extends IconGrid {
for (let i = 0; i < children.length; i++) { for (let i = 0; i < children.length; i++) {
let childBox = this._calculateChildBox(children[i], x, y, box); let childBox = this._calculateChildBox(children[i], x, y, box);
if (animateIconPosition(children[i], childBox, flags, nChangedIcons)) if (animateIconPosition(children[i], childBox, nChangedIcons))
nChangedIcons++; nChangedIcons++;
children[i].show(); children[i].show();

View File

@ -61,7 +61,7 @@ class AspectContainer extends St.Widget {
this.queue_relayout(); this.queue_relayout();
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
if (box.get_width() > 0 && box.get_height() > 0) { if (box.get_width() > 0 && box.get_height() > 0) {
let sizeRatio = box.get_width() / box.get_height(); let sizeRatio = box.get_width() / box.get_height();
@ -79,7 +79,7 @@ class AspectContainer extends St.Widget {
} }
} }
super.vfunc_allocate(box, flags); super.vfunc_allocate(box);
} }
}); });

View File

@ -554,8 +554,8 @@ var Inspector = GObject.registerClass({
this._lookingGlass = lookingGlass; this._lookingGlass = lookingGlass;
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
if (!this._eventHandler) if (!this._eventHandler)
return; return;
@ -570,7 +570,7 @@ var Inspector = GObject.registerClass({
childBox.x2 = childBox.x1 + natWidth; childBox.x2 = childBox.x1 + natWidth;
childBox.y1 = primary.y + Math.floor((primary.height - natHeight) / 2); childBox.y1 = primary.y + Math.floor((primary.height - natHeight) / 2);
childBox.y2 = childBox.y1 + natHeight; childBox.y2 = childBox.y1 + natHeight;
this._eventHandler.allocate(childBox, flags); this._eventHandler.allocate(childBox);
} }
_close() { _close() {

View File

@ -285,12 +285,12 @@ var LabelExpanderLayout = GObject.registerClass({
return [min, nat]; return [min, nat];
} }
vfunc_allocate(container, box, flags) { vfunc_allocate(container, box) {
for (let i = 0; i < container.get_n_children(); i++) { for (let i = 0; i < container.get_n_children(); i++) {
let child = container.get_child_at_index(i); let child = container.get_child_at_index(i);
if (child.visible) if (child.visible)
child.allocate(box, flags); child.allocate(box);
} }
} }

View File

@ -686,8 +686,8 @@ class SourceActorWithLabel extends SourceActor {
}); });
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
super.vfunc_allocate(box, flags); super.vfunc_allocate(box);
let childBox = new Clutter.ActorBox(); let childBox = new Clutter.ActorBox();
@ -707,7 +707,7 @@ class SourceActorWithLabel extends SourceActor {
childBox.y1 = box.y2 - naturalHeight; childBox.y1 = box.y2 - naturalHeight;
childBox.y2 = box.y2; childBox.y2 = box.y2;
this._counterBin.allocate(childBox, flags); this._counterBin.allocate(childBox);
} }
_updateCount() { _updateCount() {

View File

@ -51,7 +51,7 @@ var SlideLayout = GObject.registerClass({
return [minWidth, natWidth]; return [minWidth, natWidth];
} }
vfunc_allocate(container, box, flags) { vfunc_allocate(container, box) {
let child = container.get_first_child(); let child = container.get_first_child();
let availWidth = Math.round(box.x2 - box.x1); let availWidth = Math.round(box.x2 - box.x1);
@ -72,7 +72,7 @@ var SlideLayout = GObject.registerClass({
actorBox.y1 = box.y1; actorBox.y1 = box.y1;
actorBox.y2 = actorBox.y1 + availHeight; actorBox.y2 = actorBox.y1 + availHeight;
child.allocate(actorBox, flags); child.allocate(actorBox);
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
@ -394,10 +394,10 @@ class DashSpacer extends St.Widget {
}); });
var ControlsLayout = GObject.registerClass({ var ControlsLayout = GObject.registerClass({
Signals: { 'allocation-changed': { flags: GObject.SignalFlags.RUN_LAST } }, Signals: { 'allocation-changed': {} },
}, class ControlsLayout extends Clutter.BinLayout { }, class ControlsLayout extends Clutter.BinLayout {
vfunc_allocate(container, box, flags) { vfunc_allocate(container, box) {
super.vfunc_allocate(container, box, flags); super.vfunc_allocate(container, box);
this.emit('allocation-changed'); this.emit('allocation-changed');
} }
}); });

View File

@ -418,8 +418,8 @@ var PadDiagram = GObject.registerClass({
child.allocate(childBox, 0); child.allocate(childBox, 0);
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
super.vfunc_allocate(box, flags); super.vfunc_allocate(box);
this._updateDiagramScale(); this._updateDiagramScale();
for (let i = 0; i < this._labels.length; i++) { for (let i = 0; i < this._labels.length; i++) {

View File

@ -842,8 +842,8 @@ class Panel extends St.Widget {
return [0, 0]; return [0, 0];
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let allocWidth = box.x2 - box.x1; let allocWidth = box.x2 - box.x1;
let allocHeight = box.y2 - box.y1; let allocHeight = box.y2 - box.y1;
@ -879,13 +879,13 @@ class Panel extends St.Widget {
childBox.x2 = Math.min(Math.floor(sideWidth), childBox.x2 = Math.min(Math.floor(sideWidth),
leftNaturalWidth); leftNaturalWidth);
} }
this._leftBox.allocate(childBox, flags); this._leftBox.allocate(childBox);
childBox.x1 = Math.ceil(sideWidth); childBox.x1 = Math.ceil(sideWidth);
childBox.y1 = 0; childBox.y1 = 0;
childBox.x2 = childBox.x1 + centerWidth; childBox.x2 = childBox.x1 + centerWidth;
childBox.y2 = allocHeight; childBox.y2 = allocHeight;
this._centerBox.allocate(childBox, flags); this._centerBox.allocate(childBox);
childBox.y1 = 0; childBox.y1 = 0;
childBox.y2 = allocHeight; childBox.y2 = allocHeight;
@ -899,7 +899,7 @@ class Panel extends St.Widget {
0); 0);
childBox.x2 = allocWidth; childBox.x2 = allocWidth;
} }
this._rightBox.allocate(childBox, flags); this._rightBox.allocate(childBox);
let cornerWidth, cornerHeight; let cornerWidth, cornerHeight;
@ -909,7 +909,7 @@ class Panel extends St.Widget {
childBox.x2 = cornerWidth; childBox.x2 = cornerWidth;
childBox.y1 = allocHeight; childBox.y1 = allocHeight;
childBox.y2 = allocHeight + cornerHeight; childBox.y2 = allocHeight + cornerHeight;
this._leftCorner.allocate(childBox, flags); this._leftCorner.allocate(childBox);
[, cornerWidth] = this._rightCorner.get_preferred_width(-1); [, cornerWidth] = this._rightCorner.get_preferred_width(-1);
[, cornerHeight] = this._rightCorner.get_preferred_height(-1); [, cornerHeight] = this._rightCorner.get_preferred_height(-1);
@ -917,7 +917,7 @@ class Panel extends St.Widget {
childBox.x2 = allocWidth; childBox.x2 = allocWidth;
childBox.y1 = allocHeight; childBox.y1 = allocHeight;
childBox.y2 = allocHeight + cornerHeight; childBox.y2 = allocHeight + cornerHeight;
this._rightCorner.allocate(childBox, flags); this._rightCorner.allocate(childBox);
} }
_tryDragWindow(event) { _tryDragWindow(event) {

View File

@ -59,8 +59,8 @@ class ButtonBox extends St.Widget {
return [0, 0]; return [0, 0];
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let child = this.get_first_child(); let child = this.get_first_child();
if (!child) if (!child)
@ -83,7 +83,7 @@ class ButtonBox extends St.Widget {
childBox.y1 = 0; childBox.y1 = 0;
childBox.y2 = availHeight; childBox.y2 = availHeight;
child.allocate(childBox, flags); child.allocate(childBox);
} }
_onDestroy() { _onDestroy() {

View File

@ -16,7 +16,7 @@ var MAX_LIST_SEARCH_RESULTS_ROWS = 5;
var MaxWidthBox = GObject.registerClass( var MaxWidthBox = GObject.registerClass(
class MaxWidthBox extends St.BoxLayout { class MaxWidthBox extends St.BoxLayout {
vfunc_allocate(box, flags) { vfunc_allocate(box) {
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
let maxWidth = themeNode.get_max_width(); let maxWidth = themeNode.get_max_width();
let availWidth = box.x2 - box.x1; let availWidth = box.x2 - box.x1;
@ -28,7 +28,7 @@ class MaxWidthBox extends St.BoxLayout {
adjustedBox.x2 -= Math.floor(excessWidth / 2); adjustedBox.x2 -= Math.floor(excessWidth / 2);
} }
super.vfunc_allocate(adjustedBox, flags); super.vfunc_allocate(adjustedBox);
} }
}); });

View File

@ -805,8 +805,8 @@ class InputSourceIndicatorContainer extends St.Widget {
}, [0, 0]); }, [0, 0]);
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
// translate box to (0, 0) // translate box to (0, 0)
box.x2 -= box.x1; box.x2 -= box.x1;
@ -815,7 +815,7 @@ class InputSourceIndicatorContainer extends St.Widget {
box.y1 = 0; box.y1 = 0;
this.get_children().forEach(c => { this.get_children().forEach(c => {
c.allocate_align_fill(box, 0.5, 0.5, false, false, flags); c.allocate_align_fill(box, 0.5, 0.5, false, false);
}); });
} }
}); });

View File

@ -66,8 +66,8 @@ var SwitcherPopup = GObject.registerClass({
this._disableHover(); this._disableHover();
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let childBox = new Clutter.ActorBox(); let childBox = new Clutter.ActorBox();
let primary = Main.layoutManager.primaryMonitor; let primary = Main.layoutManager.primaryMonitor;
@ -84,7 +84,7 @@ var SwitcherPopup = GObject.registerClass({
childBox.x2 = Math.min(primary.x + primary.width - rightPadding, childBox.x1 + childNaturalWidth); childBox.x2 = Math.min(primary.x + primary.width - rightPadding, childBox.x1 + childNaturalWidth);
childBox.y1 = primary.y + Math.floor((primary.height - childNaturalHeight) / 2); childBox.y1 = primary.y + Math.floor((primary.height - childNaturalHeight) / 2);
childBox.y2 = childBox.y1 + childNaturalHeight; childBox.y2 = childBox.y1 + childNaturalHeight;
this._switcherList.allocate(childBox, flags); this._switcherList.allocate(childBox);
} }
_initialSelection(backward, _binding) { _initialSelection(backward, _binding) {
@ -591,8 +591,8 @@ var SwitcherList = GObject.registerClass({
return themeNode.adjust_preferred_height(maxChildMin, maxChildNat); return themeNode.adjust_preferred_height(maxChildMin, maxChildNat);
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let contentBox = this.get_theme_node().get_content_box(box); let contentBox = this.get_theme_node().get_content_box(box);
let width = contentBox.x2 - contentBox.x1; let width = contentBox.x2 - contentBox.x1;
@ -606,7 +606,7 @@ var SwitcherList = GObject.registerClass({
let childBox = new Clutter.ActorBox(); let childBox = new Clutter.ActorBox();
let scrollable = minListWidth > width; let scrollable = minListWidth > width;
this._scrollView.allocate(contentBox, flags); this._scrollView.allocate(contentBox);
let arrowWidth = Math.floor(leftPadding / 3); let arrowWidth = Math.floor(leftPadding / 3);
let arrowHeight = arrowWidth * 2; let arrowHeight = arrowWidth * 2;
@ -614,7 +614,7 @@ var SwitcherList = GObject.registerClass({
childBox.y1 = this.height / 2 - arrowWidth; childBox.y1 = this.height / 2 - arrowWidth;
childBox.x2 = childBox.x1 + arrowWidth; childBox.x2 = childBox.x1 + arrowWidth;
childBox.y2 = childBox.y1 + arrowHeight; childBox.y2 = childBox.y1 + arrowHeight;
this._leftArrow.allocate(childBox, flags); this._leftArrow.allocate(childBox);
this._leftArrow.opacity = this._scrollableLeft && scrollable ? 255 : 0; this._leftArrow.opacity = this._scrollableLeft && scrollable ? 255 : 0;
arrowWidth = Math.floor(rightPadding / 3); arrowWidth = Math.floor(rightPadding / 3);
@ -623,7 +623,7 @@ var SwitcherList = GObject.registerClass({
childBox.y1 = this.height / 2 - arrowWidth; childBox.y1 = this.height / 2 - arrowWidth;
childBox.x2 = childBox.x1 + arrowWidth; childBox.x2 = childBox.x1 + arrowWidth;
childBox.y2 = childBox.y1 + arrowHeight; childBox.y2 = childBox.y1 + arrowHeight;
this._rightArrow.allocate(childBox, flags); this._rightArrow.allocate(childBox);
this._rightArrow.opacity = this._scrollableRight && scrollable ? 255 : 0; this._rightArrow.opacity = this._scrollableRight && scrollable ? 255 : 0;
} }
}); });

View File

@ -405,7 +405,7 @@ class UnlockDialogLayout extends Clutter.LayoutManager {
return this._stack.get_preferred_height(forWidth); return this._stack.get_preferred_height(forWidth);
} }
vfunc_allocate(container, box, flags) { vfunc_allocate(container, box) {
let [width, height] = box.get_size(); let [width, height] = box.get_size();
let tenthOfHeight = height / 10.0; let tenthOfHeight = height / 10.0;
@ -432,7 +432,7 @@ class UnlockDialogLayout extends Clutter.LayoutManager {
actorBox.x2 = columnX1 + columnWidth; actorBox.x2 = columnX1 + columnWidth;
actorBox.y2 = actorBox.y1 + maxNotificationsHeight; actorBox.y2 = actorBox.y1 + maxNotificationsHeight;
this._notifications.allocate(actorBox, flags); this._notifications.allocate(actorBox);
// Authentication Box // Authentication Box
let stackY = Math.min( let stackY = Math.min(
@ -444,7 +444,7 @@ class UnlockDialogLayout extends Clutter.LayoutManager {
actorBox.x2 = columnX1 + columnWidth; actorBox.x2 = columnX1 + columnWidth;
actorBox.y2 = stackY + stackHeight; actorBox.y2 = stackY + stackHeight;
this._stack.allocate(actorBox, flags); this._stack.allocate(actorBox);
// Switch User button // Switch User button
if (this._switchUserButton.visible) { if (this._switchUserButton.visible) {
@ -461,7 +461,7 @@ class UnlockDialogLayout extends Clutter.LayoutManager {
actorBox.x2 = actorBox.x1 + natWidth; actorBox.x2 = actorBox.x1 + natWidth;
actorBox.y2 = actorBox.y1 + natHeight; actorBox.y2 = actorBox.y1 + natHeight;
this._switchUserButton.allocate(actorBox, flags); this._switchUserButton.allocate(actorBox);
} }
} }
}); });

View File

@ -144,8 +144,8 @@ class UserWidgetLabel extends St.Widget {
} }
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let availWidth = box.x2 - box.x1; let availWidth = box.x2 - box.x1;
let availHeight = box.y2 - box.y1; let availHeight = box.y2 - box.y1;
@ -164,7 +164,7 @@ class UserWidgetLabel extends St.Widget {
childBox.x2 = availWidth; childBox.x2 = availWidth;
childBox.y2 = availHeight; childBox.y2 = availHeight;
this._currentLabel.allocate(childBox, flags); this._currentLabel.allocate(childBox);
} }
vfunc_paint(paintContext) { vfunc_paint(paintContext) {

View File

@ -79,7 +79,7 @@ class WindowCloneLayout extends Clutter.LayoutManager {
return [this._boundingBox.width, this._boundingBox.width]; return [this._boundingBox.width, this._boundingBox.width];
} }
vfunc_allocate(container, box, flags) { vfunc_allocate(container, _box) {
container.get_children().forEach(child => { container.get_children().forEach(child => {
let realWindow; let realWindow;
if (child == container._windowClone) if (child == container._windowClone)
@ -87,8 +87,7 @@ class WindowCloneLayout extends Clutter.LayoutManager {
else else
realWindow = child.source; realWindow = child.source;
child.allocate(this._makeBoxForWindow(realWindow.meta_window), child.allocate(this._makeBoxForWindow(realWindow.meta_window));
flags);
}); });
} }
}); });

View File

@ -86,8 +86,8 @@ class WorkspaceSwitcherPopupList extends St.Widget {
return this._getSizeForOppositeOrientation(); return this._getSizeForOppositeOrientation();
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
box = themeNode.get_content_box(box); box = themeNode.get_content_box(box);
@ -111,7 +111,7 @@ class WorkspaceSwitcherPopupList extends St.Widget {
} else { } else {
y += this._childHeight + this._itemSpacing; y += this._childHeight + this._itemSpacing;
} }
child.allocate(childBox, flags); child.allocate(childBox);
} }
} }
}); });

View File

@ -1204,8 +1204,8 @@ var ThumbnailsBox = GObject.registerClass({
this.queue_relayout(); this.queue_relayout();
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL; let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL;
@ -1299,7 +1299,7 @@ var ThumbnailsBox = GObject.registerClass({
childBox.x2 = x2; childBox.x2 = x2;
childBox.y1 = Math.round(y); childBox.y1 = Math.round(y);
childBox.y2 = Math.round(y + placeholderHeight); childBox.y2 = Math.round(y + placeholderHeight);
this._dropPlaceholder.allocate(childBox, flags); this._dropPlaceholder.allocate(childBox);
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
this._dropPlaceholder.show(); this._dropPlaceholder.show();
}); });
@ -1331,7 +1331,7 @@ var ThumbnailsBox = GObject.registerClass({
childBox.y2 = y1 + portholeHeight; childBox.y2 = y1 + portholeHeight;
thumbnail.set_scale(roundedHScale, roundedVScale); thumbnail.set_scale(roundedHScale, roundedVScale);
thumbnail.allocate(childBox, flags); thumbnail.allocate(childBox);
// We round the collapsing portion so that we don't get thumbnails resizing // We round the collapsing portion so that we don't get thumbnails resizing
// during an animation due to differences in rounded, but leave the uncollapsed // during an animation due to differences in rounded, but leave the uncollapsed
@ -1355,6 +1355,6 @@ var ThumbnailsBox = GObject.registerClass({
childBox.x2 += indicatorRightFullBorder; childBox.x2 += indicatorRightFullBorder;
childBox.y1 = indicatorY1 - indicatorTopFullBorder; childBox.y1 = indicatorY1 - indicatorTopFullBorder;
childBox.y2 = indicatorY2 + indicatorBottomFullBorder; childBox.y2 = indicatorY2 + indicatorBottomFullBorder;
this._indicator.allocate(childBox, flags); this._indicator.allocate(childBox);
} }
}); });

View File

@ -268,15 +268,14 @@ shell_gtk_embed_get_preferred_height (ClutterActor *actor,
static void static void
shell_gtk_embed_allocate (ClutterActor *actor, shell_gtk_embed_allocate (ClutterActor *actor,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor); ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed); ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
float wx, wy; float wx, wy;
CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)-> CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->
allocate (actor, box, flags); allocate (actor, box);
/* Find the actor's new coordinates in terms of the stage (which is /* Find the actor's new coordinates in terms of the stage (which is
* priv->window's parent window. * priv->window's parent window.

View File

@ -25,14 +25,13 @@ G_DEFINE_TYPE (ShellStack, shell_stack, ST_TYPE_WIDGET);
static void static void
shell_stack_allocate (ClutterActor *self, shell_stack_allocate (ClutterActor *self,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
ClutterActorBox content_box; ClutterActorBox content_box;
ClutterActor *child; ClutterActor *child;
clutter_actor_set_allocation (self, box, flags); clutter_actor_set_allocation (self, box);
st_theme_node_get_content_box (theme_node, box, &content_box); st_theme_node_get_content_box (theme_node, box, &content_box);
@ -41,7 +40,7 @@ shell_stack_allocate (ClutterActor *self,
child = clutter_actor_get_next_sibling (child)) child = clutter_actor_get_next_sibling (child))
{ {
ClutterActorBox child_box = content_box; ClutterActorBox child_box = content_box;
clutter_actor_allocate (child, &child_box, flags); clutter_actor_allocate (child, &child_box);
} }
} }

View File

@ -115,12 +115,11 @@ get_align_factor (ClutterActorAlign align)
static void static void
st_bin_allocate (ClutterActor *self, st_bin_allocate (ClutterActor *self,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (self)); StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (self));
clutter_actor_set_allocation (self, box, flags); clutter_actor_set_allocation (self, box);
if (priv->child && clutter_actor_is_visible (priv->child)) if (priv->child && clutter_actor_is_visible (priv->child))
{ {
@ -134,8 +133,7 @@ st_bin_allocate (ClutterActor *self,
get_align_factor (x_align), get_align_factor (x_align),
get_align_factor (y_align), get_align_factor (y_align),
x_align == CLUTTER_ACTOR_ALIGN_FILL, x_align == CLUTTER_ACTOR_ALIGN_FILL,
y_align == CLUTTER_ACTOR_ALIGN_FILL, y_align == CLUTTER_ACTOR_ALIGN_FILL);
flags);
} }
} }

View File

@ -77,8 +77,7 @@ draw_content (ClutterCanvas *canvas,
static void static void
st_drawing_area_allocate (ClutterActor *self, st_drawing_area_allocate (ClutterActor *self,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
ClutterContent *content = clutter_actor_get_content (self); ClutterContent *content = clutter_actor_get_content (self);
@ -89,11 +88,11 @@ st_drawing_area_allocate (ClutterActor *self,
if (!st_widget_get_resource_scale (ST_WIDGET (self), &resource_scale)) if (!st_widget_get_resource_scale (ST_WIDGET (self), &resource_scale))
{ {
ClutterActorBox empty = CLUTTER_ACTOR_BOX_INIT_ZERO; ClutterActorBox empty = CLUTTER_ACTOR_BOX_INIT_ZERO;
clutter_actor_set_allocation (self, &empty, 0); clutter_actor_set_allocation (self, &empty);
return; return;
} }
clutter_actor_set_allocation (self, box, flags); clutter_actor_set_allocation (self, box);
st_theme_node_get_content_box (theme_node, box, &content_box); st_theme_node_get_content_box (theme_node, box, &content_box);
width = (int)(0.5 + content_box.x2 - content_box.x1); width = (int)(0.5 + content_box.x2 - content_box.x1);

View File

@ -416,8 +416,7 @@ st_entry_get_preferred_height (ClutterActor *actor,
static void static void
st_entry_allocate (ClutterActor *actor, st_entry_allocate (ClutterActor *actor,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (actor); StEntryPrivate *priv = ST_ENTRY_PRIV (actor);
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
@ -441,7 +440,7 @@ st_entry_allocate (ClutterActor *actor,
right_icon = priv->secondary_icon; right_icon = priv->secondary_icon;
} }
clutter_actor_set_allocation (actor, box, flags); clutter_actor_set_allocation (actor, box);
st_theme_node_get_content_box (theme_node, box, &content_box); st_theme_node_get_content_box (theme_node, box, &content_box);
@ -461,7 +460,7 @@ st_entry_allocate (ClutterActor *actor,
icon_box.y1 = (int) (content_box.y1 + avail_h / 2 - icon_h / 2); icon_box.y1 = (int) (content_box.y1 + avail_h / 2 - icon_h / 2);
icon_box.y2 = icon_box.y1 + icon_h; icon_box.y2 = icon_box.y1 + icon_h;
clutter_actor_allocate (left_icon, &icon_box, flags); clutter_actor_allocate (left_icon, &icon_box);
/* reduce the size for the entry */ /* reduce the size for the entry */
child_box.x1 = MIN (child_box.x2, child_box.x1 + icon_w + priv->spacing); child_box.x1 = MIN (child_box.x2, child_box.x1 + icon_w + priv->spacing);
@ -478,7 +477,7 @@ st_entry_allocate (ClutterActor *actor,
icon_box.y1 = (int) (content_box.y1 + avail_h / 2 - icon_h / 2); icon_box.y1 = (int) (content_box.y1 + avail_h / 2 - icon_h / 2);
icon_box.y2 = icon_box.y1 + icon_h; icon_box.y2 = icon_box.y1 + icon_h;
clutter_actor_allocate (right_icon, &icon_box, flags); clutter_actor_allocate (right_icon, &icon_box);
/* reduce the size for the entry */ /* reduce the size for the entry */
child_box.x2 = MAX (child_box.x1, child_box.x2 - icon_w - priv->spacing); child_box.x2 = MAX (child_box.x1, child_box.x2 - icon_w - priv->spacing);
@ -502,7 +501,7 @@ st_entry_allocate (ClutterActor *actor,
hint_box.y1 = ceil (content_box.y1 + avail_h / 2 - hint_h / 2); hint_box.y1 = ceil (content_box.y1 + avail_h / 2 - hint_h / 2);
hint_box.y2 = hint_box.y1 + hint_h; hint_box.y2 = hint_box.y1 + hint_h;
clutter_actor_allocate (priv->hint_actor, &hint_box, flags); clutter_actor_allocate (priv->hint_actor, &hint_box);
} }
clutter_actor_get_preferred_height (priv->entry, child_box.x2 - child_box.x1, clutter_actor_get_preferred_height (priv->entry, child_box.x2 - child_box.x1,
@ -513,7 +512,7 @@ st_entry_allocate (ClutterActor *actor,
child_box.y1 = (int) (content_box.y1 + avail_h / 2 - entry_h / 2); child_box.y1 = (int) (content_box.y1 + avail_h / 2 - entry_h / 2);
child_box.y2 = child_box.y1 + entry_h; child_box.y2 = child_box.y1 + entry_h;
clutter_actor_allocate (priv->entry, &child_box, flags); clutter_actor_allocate (priv->entry, &child_box);
} }
static void static void

View File

@ -165,18 +165,17 @@ st_label_get_preferred_height (ClutterActor *actor,
static void static void
st_label_allocate (ClutterActor *actor, st_label_allocate (ClutterActor *actor,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StLabelPrivate *priv = ST_LABEL (actor)->priv; StLabelPrivate *priv = ST_LABEL (actor)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
ClutterActorBox content_box; ClutterActorBox content_box;
clutter_actor_set_allocation (actor, box, flags); clutter_actor_set_allocation (actor, box);
st_theme_node_get_content_box (theme_node, box, &content_box); st_theme_node_get_content_box (theme_node, box, &content_box);
clutter_actor_allocate (priv->label, &content_box, flags); clutter_actor_allocate (priv->label, &content_box);
} }
static void static void

View File

@ -192,8 +192,7 @@ st_scroll_bar_unmap (ClutterActor *actor)
static void static void
scroll_bar_allocate_children (StScrollBar *bar, scroll_bar_allocate_children (StScrollBar *bar,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar);
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (bar)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (bar));
@ -207,7 +206,7 @@ scroll_bar_allocate_children (StScrollBar *bar,
trough_box.y1 = content_box.y1; trough_box.y1 = content_box.y1;
trough_box.x2 = content_box.x2; trough_box.x2 = content_box.x2;
trough_box.y2 = content_box.y2; trough_box.y2 = content_box.y2;
clutter_actor_allocate (priv->trough, &trough_box, flags); clutter_actor_allocate (priv->trough, &trough_box);
} }
else else
{ {
@ -215,7 +214,7 @@ scroll_bar_allocate_children (StScrollBar *bar,
trough_box.y1 = content_box.y1; trough_box.y1 = content_box.y1;
trough_box.x2 = content_box.x2; trough_box.x2 = content_box.x2;
trough_box.y2 = content_box.y2; trough_box.y2 = content_box.y2;
clutter_actor_allocate (priv->trough, &trough_box, flags); clutter_actor_allocate (priv->trough, &trough_box);
} }
@ -274,9 +273,7 @@ scroll_bar_allocate_children (StScrollBar *bar,
handle_box.y2 = content_box.y2; handle_box.y2 = content_box.y2;
} }
clutter_actor_allocate (priv->handle, clutter_actor_allocate (priv->handle, &handle_box);
&handle_box,
flags);
} }
} }
@ -362,14 +359,13 @@ st_scroll_bar_get_preferred_height (ClutterActor *self,
static void static void
st_scroll_bar_allocate (ClutterActor *actor, st_scroll_bar_allocate (ClutterActor *actor,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StScrollBar *bar = ST_SCROLL_BAR (actor); StScrollBar *bar = ST_SCROLL_BAR (actor);
clutter_actor_set_allocation (actor, box, flags); clutter_actor_set_allocation (actor, box);
scroll_bar_allocate_children (bar, box, flags); scroll_bar_allocate_children (bar, box);
} }
static void static void
@ -392,7 +388,7 @@ scroll_bar_update_positions (StScrollBar *bar)
return; return;
clutter_actor_get_allocation_box (CLUTTER_ACTOR (bar), &box); clutter_actor_get_allocation_box (CLUTTER_ACTOR (bar), &box);
scroll_bar_allocate_children (bar, &box, CLUTTER_ALLOCATION_NONE); scroll_bar_allocate_children (bar, &box);
} }
static void static void

View File

@ -533,8 +533,7 @@ st_scroll_view_get_preferred_height (ClutterActor *actor,
static void static void
st_scroll_view_allocate (ClutterActor *actor, st_scroll_view_allocate (ClutterActor *actor,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
ClutterActorBox content_box, child_box; ClutterActorBox content_box, child_box;
gfloat avail_width, avail_height, sb_width, sb_height; gfloat avail_width, avail_height, sb_width, sb_height;
@ -543,7 +542,7 @@ st_scroll_view_allocate (ClutterActor *actor,
StScrollViewPrivate *priv = ST_SCROLL_VIEW (actor)->priv; StScrollViewPrivate *priv = ST_SCROLL_VIEW (actor)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
clutter_actor_set_allocation (actor, box, flags); clutter_actor_set_allocation (actor, box);
st_theme_node_get_content_box (theme_node, box, &content_box); st_theme_node_get_content_box (theme_node, box, &content_box);
@ -641,7 +640,7 @@ st_scroll_view_allocate (ClutterActor *actor,
child_box.y1 = content_box.y1; child_box.y1 = content_box.y1;
child_box.y2 = content_box.y2 - (hscrollbar_visible ? sb_height : 0); child_box.y2 = content_box.y2 - (hscrollbar_visible ? sb_height : 0);
clutter_actor_allocate (priv->vscroll, &child_box, flags); clutter_actor_allocate (priv->vscroll, &child_box);
/* Horizontal scrollbar */ /* Horizontal scrollbar */
if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL) if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL)
@ -657,7 +656,7 @@ st_scroll_view_allocate (ClutterActor *actor,
child_box.y1 = content_box.y2 - sb_height; child_box.y1 = content_box.y2 - sb_height;
child_box.y2 = content_box.y2; child_box.y2 = content_box.y2;
clutter_actor_allocate (priv->hscroll, &child_box, flags); clutter_actor_allocate (priv->hscroll, &child_box);
/* In case the scrollbar policy is NEVER or EXTERNAL or scrollbars /* In case the scrollbar policy is NEVER or EXTERNAL or scrollbars
* should be overlayed, we don't trim the content box allocation by * should be overlayed, we don't trim the content box allocation by
@ -689,7 +688,7 @@ st_scroll_view_allocate (ClutterActor *actor,
child_box.y2 = content_box.y2 - sb_height; child_box.y2 = content_box.y2 - sb_height;
if (priv->child) if (priv->child)
clutter_actor_allocate (priv->child, &child_box, flags); clutter_actor_allocate (priv->child, &child_box);
if (priv->hscrollbar_visible != hscrollbar_visible) if (priv->hscrollbar_visible != hscrollbar_visible)
{ {

View File

@ -231,8 +231,7 @@ st_viewport_dispose (GObject *object)
static void static void
st_viewport_allocate (ClutterActor *actor, st_viewport_allocate (ClutterActor *actor,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StViewport *viewport = ST_VIEWPORT (actor); StViewport *viewport = ST_VIEWPORT (actor);
StViewportPrivate *priv = StViewportPrivate *priv =
@ -259,14 +258,14 @@ st_viewport_allocate (ClutterActor *actor,
* may not match the minimum sizes reported by the layout manager. When that * may not match the minimum sizes reported by the layout manager. When that
* happens, the content box needs to be adjusted to match the reported minimum * happens, the content box needs to be adjusted to match the reported minimum
* sizes before being passed to clutter_layout_manager_allocate() */ * sizes before being passed to clutter_layout_manager_allocate() */
clutter_actor_set_allocation (actor, box, flags); clutter_actor_set_allocation (actor, box);
content_box = viewport_box; content_box = viewport_box;
content_box.x2 += MAX (0, min_width - avail_width); content_box.x2 += MAX (0, min_width - avail_width);
content_box.y2 += MAX (0, min_height - avail_height); content_box.y2 += MAX (0, min_height - avail_height);
clutter_layout_manager_allocate (layout, CLUTTER_CONTAINER (actor), clutter_layout_manager_allocate (layout, CLUTTER_CONTAINER (actor),
&content_box, flags); &content_box);
/* update adjustments for scrolling */ /* update adjustments for scrolling */
if (priv->vadjustment) if (priv->vadjustment)

View File

@ -371,8 +371,7 @@ st_widget_get_preferred_height (ClutterActor *self,
static void static void
st_widget_allocate (ClutterActor *actor, st_widget_allocate (ClutterActor *actor,
const ClutterActorBox *box, const ClutterActorBox *box)
ClutterAllocationFlags flags)
{ {
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
ClutterActorBox content_box; ClutterActorBox content_box;
@ -383,7 +382,7 @@ st_widget_allocate (ClutterActor *actor,
* manager, meaning that we can't modify it for children only. * manager, meaning that we can't modify it for children only.
*/ */
clutter_actor_set_allocation (actor, box, flags); clutter_actor_set_allocation (actor, box);
st_theme_node_get_content_box (theme_node, box, &content_box); st_theme_node_get_content_box (theme_node, box, &content_box);
@ -391,8 +390,7 @@ st_widget_allocate (ClutterActor *actor,
* currently installed layout manager */ * currently installed layout manager */
clutter_layout_manager_allocate (clutter_actor_get_layout_manager (actor), clutter_layout_manager_allocate (clutter_actor_get_layout_manager (actor),
CLUTTER_CONTAINER (actor), CLUTTER_CONTAINER (actor),
&content_box, &content_box);
flags);
} }
/** /**

View File

@ -98,13 +98,12 @@ class FlowedBoxes extends St.Widget {
return [height, height]; return [height, height];
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
this._layoutChildren(box.x2 - box.x1, this._layoutChildren(box.x2 - box.x1,
function(child, x1, y1, x2, y2) { function(child, x1, y1, x2, y2) {
child.allocate(new Clutter.ActorBox({ x1: x1, y1: y1, x2: x2, y2: y2 }), child.allocate(new Clutter.ActorBox({ x1: x1, y1: y1, x2: x2, y2: y2 }));
flags);
}); });
} }
}); });
@ -185,8 +184,8 @@ class SizingIllustrator extends St.Widget {
return [0, 400]; return [0, 400];
} }
vfunc_allocate(box, flags) { vfunc_allocate(box) {
this.set_allocation(box, flags); this.set_allocation(box);
box = this.get_theme_node().get_content_box(box); box = this.get_theme_node().get_content_box(box);
@ -194,8 +193,7 @@ class SizingIllustrator extends St.Widget {
let allocHeight = box.y2 - box.y1; let allocHeight = box.y2 - box.y1;
function alloc(child, x1, y1, x2, y2) { function alloc(child, x1, y1, x2, y2) {
child.allocate(new Clutter.ActorBox({ x1: x1, y1: y1, x2: x2, y2: y2 }), child.allocate(new Clutter.ActorBox({ x1: x1, y1: y1, x2: x2, y2: y2 }));
flags);
} }
alloc(this.child, 0, 0, this.width, this.height); alloc(this.child, 0, 0, this.width, this.height);