[gnome-shell] main: don't use a BindConstraint for uiGroup
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] main: don't use a BindConstraint for uiGroup
- Date: Fri, 13 Apr 2012 13:20:00 +0000 (UTC)
commit 8c94a5afb97d43731009f07e2c0cfef319cdf42c
Author: Stefano Facchini <stefano facchini gmail com>
Date: Wed Feb 22 18:18:15 2012 +0100
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
js/ui/main.js | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index ac9330c..07a3174 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -194,9 +194,16 @@ function start() {
for (let i = 0; i < children.length; i++)
children[i].allocate_preferred_size(flags);
});
- let constraint = new Clutter.BindConstraint({ source: global.stage,
- coordinate: Clutter.BindCoordinate.SIZE });
- uiGroup.add_constraint(constraint);
+ uiGroup.connect('get-preferred-width',
+ function(actor, forHeight, alloc) {
+ 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.overlay_group.reparent(uiGroup);
global.stage.add_actor(uiGroup);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]