[stage] Force an allocation before showing the stage
authorNeil Roberts <neil@linux.intel.com>
Fri, 17 Jul 2009 11:43:52 +0000 (12:43 +0100)
committerNeil Roberts <neil@linux.intel.com>
Fri, 17 Jul 2009 11:43:52 +0000 (12:43 +0100)
A lot of applications change the size of the stage from the default
before the stage is initially shown. The size change won't take affect
until the first allocation run. However we want the window to be at
the correct size when we first map it so we should force an allocation
run before showing the stage.

There was an explicit call to XResizeWindow in
clutter_stage_x11_show. This is not needed anymore because
XResizeWindow will already have been called by the allocate method.

clutter/clutter-stage.c
clutter/x11/clutter-stage-x11.c

index ec29766..a2f4263 100644 (file)
@@ -321,6 +321,10 @@ clutter_stage_show (ClutterActor *self)
 
   CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->show (self);
 
+  /* Possibly do an allocation run so that the stage will have the
+     right size before we map it */
+  _clutter_stage_maybe_relayout (self);
+
   g_assert (priv->impl != NULL);
   impl = CLUTTER_STAGE_WINDOW (priv->impl);
   CLUTTER_STAGE_WINDOW_GET_IFACE (impl)->show (impl, TRUE);
index 1bbd682..748cac7 100644 (file)
@@ -562,21 +562,6 @@ clutter_stage_x11_show (ClutterStageWindow *stage_window,
           CLUTTER_NOTE (BACKEND, "Mapping stage[%lu]",
                         (unsigned long) stage_x11->xwin);
 
-          if (!stage_x11->is_foreign_xwin)
-            {
-              CLUTTER_NOTE (BACKEND, "Resizing stage[%lu] (%d, %d)",
-                            (unsigned long) stage_x11->xwin,
-                            stage_x11->xwin_width,
-                            stage_x11->xwin_height);
-
-              CLUTTER_SET_PRIVATE_FLAGS (stage_x11->wrapper,
-                                         CLUTTER_STAGE_IN_RESIZE);
-
-              XResizeWindow (stage_x11->xdpy, stage_x11->xwin,
-                             stage_x11->xwin_width,
-                             stage_x11->xwin_height);
-            }
-
           if (stage_x11->fullscreen_on_map)
             clutter_stage_x11_set_fullscreen (stage_window, TRUE);
           else