diff --git a/ChangeLog b/ChangeLog index 2bec60f70..fae571f30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-06-25 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_min_width), + (clutter_actor_set_min_height), + (clutter_actor_set_natural_width), + (clutter_actor_set_natural_height): If setting the minimum + and natural width and height on a top-level actor, and on + a backend that provides only static stages, then override + the value and use the size of the display as returned by + the backend. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_realize): Remove the setting of the + minimum and natural width and height. + 2008-06-25 Emmanuele Bassi * clutter/clutter-stage.c: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 5602769fa..890138f6e 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -3641,6 +3641,22 @@ clutter_actor_set_min_width (ClutterActor *self, ClutterActorPrivate *priv = self->priv; ClutterActorBox old = { 0, }; + if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) + { + if (clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)) + { + ClutterBackend *backend = clutter_get_default_backend (); + gint display_width; + + clutter_backend_get_display_size (backend, + &display_width, + NULL); + + if (min_width != (CLUTTER_UNITS_FROM_DEVICE (display_width))) + min_width = CLUTTER_UNITS_FROM_DEVICE (display_width); + } + } + if (priv->min_width_set && min_width == priv->request_min_width) return; @@ -3667,6 +3683,22 @@ clutter_actor_set_min_height (ClutterActor *self, ClutterActorPrivate *priv = self->priv; ClutterActorBox old = { 0, }; + if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) + { + if (clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)) + { + ClutterBackend *backend = clutter_get_default_backend (); + gint display_height; + + clutter_backend_get_display_size (backend, + NULL, + &display_height); + + if (min_height != (CLUTTER_UNITS_FROM_DEVICE (display_height))) + min_height = CLUTTER_UNITS_FROM_DEVICE (display_height); + } + } + if (priv->min_height_set && min_height == priv->request_min_height) return; @@ -3692,6 +3724,22 @@ clutter_actor_set_natural_width (ClutterActor *self, ClutterActorPrivate *priv = self->priv; ClutterActorBox old = { 0, }; + if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) + { + if (clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)) + { + ClutterBackend *backend = clutter_get_default_backend (); + gint display_width; + + clutter_backend_get_display_size (backend, + &display_width, + NULL); + + if (natural_width != (CLUTTER_UNITS_FROM_DEVICE (display_width))) + natural_width = CLUTTER_UNITS_FROM_DEVICE (display_width); + } + } + if (priv->natural_width_set && natural_width == priv->request_natural_width) return; @@ -3718,6 +3766,22 @@ clutter_actor_set_natural_height (ClutterActor *self, ClutterActorPrivate *priv = self->priv; ClutterActorBox old = { 0, }; + if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) + { + if (clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)) + { + ClutterBackend *backend = clutter_get_default_backend (); + gint display_height; + + clutter_backend_get_display_size (backend, + NULL, + &display_height); + + if (natural_height != (CLUTTER_UNITS_FROM_DEVICE (display_height))) + natural_height = CLUTTER_UNITS_FROM_DEVICE (display_height); + } + } + if (priv->natural_height_set && natural_height == priv->request_natural_height) return; diff --git a/clutter/eglnative/clutter-stage-egl.c b/clutter/eglnative/clutter-stage-egl.c index ba4078c7d..f56eaf13b 100644 --- a/clutter/eglnative/clutter-stage-egl.c +++ b/clutter/eglnative/clutter-stage-egl.c @@ -86,8 +86,6 @@ clutter_stage_egl_realize (ClutterActor *actor) #endif /* HAVE_COGL_GLES2 */ EGL_NONE }; - ClutterUnit widthu, heightu; - status = eglGetConfigs (backend_egl->edpy, configs, 2, @@ -155,23 +153,7 @@ clutter_stage_egl_realize (ClutterActor *actor) stage_egl->surface_width, stage_egl->surface_height); - widthu = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_width); - heightu = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_height); - - CLUTTER_NOTE (BACKEND, "Setting minimum and natural width and height " - "to the EGL surface width and height"); - - g_object_set (G_OBJECT (stage_egl), - "min-width", widthu, - "min-width-set", TRUE, - "natural-width", widthu, - "natural-width-set", TRUE, - "min-height", heightu, - "min-height-set", TRUE, - "natural-height", heightu, - "natural-height-set", TRUE, - NULL); - + if (G_UNLIKELY (backend_egl->egl_context == NULL)) { #ifdef HAVE_COGL_GLES2