2008-06-25 Emmanuele Bassi <set EMAIL_ADDRESS environment variable>
authorEmmanuele Bassi <ebassi@openedhand.com>
Wed, 25 Jun 2008 14:47:00 +0000 (14:47 +0000)
committerEmmanuele Bassi <ebassi@openedhand.com>
Wed, 25 Jun 2008 14:47:00 +0000 (14:47 +0000)
* 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.

ChangeLog
clutter/clutter-actor.c
clutter/eglnative/clutter-stage-egl.c

index 2bec60f..fae571f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-06-25  Emmanuele Bassi  <set EMAIL_ADDRESS environment variable>
+
+       * 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  <ebassi@openedhand.com>
 
        * clutter/clutter-stage.c:
index 5602769..890138f 100644 (file)
@@ -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;
index ba4078c..f56eaf1 100644 (file)
@@ -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