main: don't use a BindConstraint for uiGroup
A BindConstraint on the size of uiGroup forces full redraws of the scene. Instead, implement and use get_preferred_width and get_preferred_height. https://bugzilla.gnome.org/show_bug.cgi?id=670636
This commit is contained in:
parent
aeb117c9d1
commit
8c94a5afb9
@ -194,9 +194,16 @@ function start() {
|
|||||||
for (let i = 0; i < children.length; i++)
|
for (let i = 0; i < children.length; i++)
|
||||||
children[i].allocate_preferred_size(flags);
|
children[i].allocate_preferred_size(flags);
|
||||||
});
|
});
|
||||||
let constraint = new Clutter.BindConstraint({ source: global.stage,
|
uiGroup.connect('get-preferred-width',
|
||||||
coordinate: Clutter.BindCoordinate.SIZE });
|
function(actor, forHeight, alloc) {
|
||||||
uiGroup.add_constraint(constraint);
|
let width = global.stage.width;
|
||||||
|
[alloc.min_size, alloc.natural_size] = [width, width];
|
||||||
|
});
|
||||||
|
uiGroup.connect('get-preferred-height',
|
||||||
|
function(actor, forWidth, alloc) {
|
||||||
|
let height = global.stage.height;
|
||||||
|
[alloc.min_size, alloc.natural_size] = [height, height];
|
||||||
|
});
|
||||||
global.window_group.reparent(uiGroup);
|
global.window_group.reparent(uiGroup);
|
||||||
global.overlay_group.reparent(uiGroup);
|
global.overlay_group.reparent(uiGroup);
|
||||||
global.stage.add_actor(uiGroup);
|
global.stage.add_actor(uiGroup);
|
||||||
|
Loading…
Reference in New Issue
Block a user