gnome-games r8184 - trunk/aisleriot



Author: chpe
Date: Thu Oct 23 14:22:50 2008
New Revision: 8184
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8184&view=rev

Log:
Don't realize the clutter-embed widget from gtk_widget_show() !
Partially fixes window size persistence; still the window first flashes
at the default size then resizes.

Modified:
   trunk/aisleriot/clutter-embed.c

Modified: trunk/aisleriot/clutter-embed.c
==============================================================================
--- trunk/aisleriot/clutter-embed.c	(original)
+++ trunk/aisleriot/clutter-embed.c	Thu Oct 23 14:22:50 2008
@@ -110,10 +110,6 @@
 {
   AisleriotClutterEmbedPrivate *priv = AISLERIOT_CLUTTER_EMBED (widget)->priv;
 
-  /* Make sure the widget is realised before we show */
-  if (!GTK_WIDGET_REALIZED (widget))
-    gtk_widget_realize (widget);
-
   clutter_actor_show (priv->stage);
 
   GTK_WIDGET_CLASS (aisleriot_clutter_embed_parent_class)->show (widget);
@@ -136,6 +132,21 @@
   GdkWindowAttr attributes;
   int attributes_mask;
   
+#ifdef GDK_WINDOWING_X11
+  {
+    const XVisualInfo *xvinfo;
+    GdkVisual *visual;
+    GdkColormap *colormap;
+
+    /* We need to use the colormap from the Clutter visual */
+    xvinfo = clutter_x11_get_stage_visual (CLUTTER_STAGE (priv->stage));
+    visual = gdk_x11_screen_lookup_visual (gdk_screen_get_default (),
+                                           xvinfo->visualid);
+    colormap = gdk_colormap_new (visual, FALSE);
+    gtk_widget_set_colormap (widget, colormap);
+  }
+#endif
+
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
 
   attributes.window_type = GDK_WINDOW_CHILD;
@@ -170,13 +181,16 @@
   
   gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
 
+  /* we must realize the stage to get it ready for embedding */
+  clutter_actor_realize (priv->stage);
+
 #if defined(GDK_WINDOWING_X11)
   clutter_x11_set_stage_foreign (CLUTTER_STAGE (priv->stage), 
                                  GDK_WINDOW_XID (widget->window));
 #elif defined(GDK_WINDOWING_WIN32)
   clutter_win32_set_stage_foreign (CLUTTER_STAGE (priv->stage), 
 				   GDK_WINDOW_HWND (widget->window));
-#endif /* HAVE_CLUTTER_GTK_{X11,WIN32} */
+#endif /* GDK_WINDOWING_{X11,WIN32} */
 
   clutter_actor_queue_redraw (CLUTTER_ACTOR (priv->stage));
 
@@ -404,24 +418,6 @@
 
   /* we always create new stages rather than use the default */
   priv->stage = clutter_stage_new ();
-
-  /* we must realize the stage to get it ready for embedding */
-  clutter_actor_realize (priv->stage);
-
-#ifdef GDK_WINDOWING_X11
-  {
-    const XVisualInfo *xvinfo;
-    GdkVisual *visual;
-    GdkColormap *colormap;
-
-    /* We need to use the colormap from the Clutter visual */
-    xvinfo = clutter_x11_get_stage_visual (CLUTTER_STAGE (priv->stage));
-    visual = gdk_x11_screen_lookup_visual (gdk_screen_get_default (),
-                                           xvinfo->visualid);
-    colormap = gdk_colormap_new (visual, FALSE);
-    gtk_widget_set_colormap (GTK_WIDGET (embed), colormap);
-  }
-#endif
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]