From 411b5a09bb11d2b8831d676298d4632ab47ecd21 Mon Sep 17 00:00:00 2001 From: Roman Kudiyarov Date: Wed, 21 Jul 2010 23:22:57 +0700 Subject: [PATCH] osx: Added size initialization for stage After stage creation it's size can be changed by user and it should be taken into account in clutter_stage_osx_realize. --- clutter/osx/clutter-stage-osx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/clutter/osx/clutter-stage-osx.c b/clutter/osx/clutter-stage-osx.c index 26f5bc52c..b200c6f16 100644 --- a/clutter/osx/clutter-stage-osx.c +++ b/clutter/osx/clutter-stage-osx.c @@ -263,7 +263,17 @@ clutter_stage_osx_realize (ClutterStageWindow *stage_window) CLUTTER_OSX_POOL_ALLOC(); backend_osx = CLUTTER_BACKEND_OSX (self->backend); - + /* Call get_size - this will either get the geometry size (which + * before we create the window is set to 640x480), or if a size + * is set, it will get that. This lets you set a size on the + * stage before it's realized. + */ + gfloat width, height; + clutter_actor_get_size (CLUTTER_ACTOR (self->wrapper), + &width, + &height); + self->requisition_width = width; + self->requisition_height= height; NSRect rect = NSMakeRect(0, 0, self->requisition_width, self->requisition_height); self->view = [[ClutterGLView alloc]