[maemo-commits] [maemo-commits] r12663 - in projects/haf/trunk/hildon-desktop: . libhildondesktop src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jul 5 15:08:12 EEST 2007
Author: jobi
Date: 2007-07-05 15:08:11 +0300 (Thu, 05 Jul 2007)
New Revision: 12663

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c
   projects/haf/trunk/hildon-desktop/src/hd-home-window.c
Log:

2007-07-05  Johan Bilien  <johan.bilien at nokia.com>

	* libhildondesktop/hildon-home-area.c:
	- sort the stack order after the container is realized,
	instead of doing it after each child. This was changing the
	order of the children while the same list was being iterated.



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-05 11:55:42 UTC (rev 12662)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-05 12:08:11 UTC (rev 12663)
@@ -1,3 +1,10 @@
+2007-07-05  Johan Bilien  <johan.bilien at nokia.com>
+
+	* libhildondesktop/hildon-home-area.c:
+	- sort the stack order after the container is realized,
+	instead of doing it after each child. This was changing the
+	order of the children while the same list was being iterated.
+
 2007-07-05  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* libhildondesktop/notification-manager.xml,

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c	2007-07-05 11:55:42 UTC (rev 12662)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c	2007-07-05 12:08:11 UTC (rev 12663)
@@ -182,11 +182,11 @@
                                 HildonHomeArea        *area);
 
 
-#ifdef HAVE_X_COMPOSITE
-
 static void
 hildon_home_area_realize (GtkWidget *widget);
 
+#ifdef HAVE_X_COMPOSITE
+
 static void
 hildon_home_area_unrealize (GtkWidget *widget);
 
@@ -221,6 +221,8 @@
 
 #endif
 
+static void
+hildon_home_area_sort_stack (HildonHomeArea *area);
 
 static void
 hildon_home_area_finalize (GObject *object);
@@ -331,11 +333,11 @@
 
   widget_class->size_allocate = hildon_home_area_size_allocate;
   widget_class->size_request  = hildon_home_area_size_request;
+  widget_class->realize       = hildon_home_area_realize;
 
 #ifdef HAVE_X_COMPOSITE
   if (klass->composite)
     {
-      widget_class->realize      = hildon_home_area_realize;
       widget_class->unrealize    = hildon_home_area_unrealize;
       widget_class->expose_event = hildon_home_area_expose;
     }
@@ -809,36 +811,29 @@
     }
 
 }
-
-#ifdef HAVE_X_COMPOSITE
-
 static void
 hildon_home_area_realize (GtkWidget *widget)
 {
-  HildonHomeAreaPriv           *priv;
-  XRenderPictureAttributes      pa;
-  XRenderPictFormat            *format;
-
   GTK_WIDGET_CLASS (parent_class)->realize (widget);
 
-  XCompositeRedirectSubwindows (GDK_DISPLAY (),
-                                GDK_WINDOW_XID (widget->window),
-                                CompositeRedirectManual);
+#ifdef HAVE_X_COMPOSITE
+  if (HILDON_HOME_AREA_GET_CLASS (widget)->composite)
+    {
 
-  priv = HILDON_HOME_AREA_GET_PRIVATE (widget);
+      XCompositeRedirectSubwindows (GDK_DISPLAY (),
+                                    GDK_WINDOW_XID (widget->window),
+                                    CompositeRedirectManual);
 
-  format = XRenderFindVisualFormat (GDK_DISPLAY(),
-                                    GDK_VISUAL_XVISUAL (
-                                     gdk_drawable_get_visual (widget->window)));
+    }
+#endif
 
-  pa.subwindow_mode = IncludeInferiors;
-  priv->picture = XRenderCreatePicture (GDK_DISPLAY (),
-                                        GDK_WINDOW_XID (widget->window),
-                                        format,
-                                        CPSubwindowMode,
-                                        &pa);
+  hildon_home_area_sort_stack (HILDON_HOME_AREA (widget));
+
 }
 
+
+#ifdef HAVE_X_COMPOSITE
+
 static void
 hildon_home_area_unrealize (GtkWidget *widget)
 {
@@ -956,7 +951,6 @@
           hildon_home_area_put (HILDON_HOME_AREA (area), applet, 0, 0, G_MAXINT);
         }
 
-      g_signal_emit_by_name (area, "layout-changed");
 
       if (priv->layout_mode)
         hildon_desktop_home_item_set_layout_mode (HILDON_DESKTOP_HOME_ITEM (applet),
@@ -2245,6 +2239,7 @@
     {
       priv->batch_add = FALSE;
       hildon_home_area_batch_add (area);
+      g_signal_emit_by_name (area, "layout-changed");
     }
 
   priv->batch_add = batch_add;

Modified: projects/haf/trunk/hildon-desktop/src/hd-home-window.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-home-window.c	2007-07-05 11:55:42 UTC (rev 12662)
+++ projects/haf/trunk/hildon-desktop/src/hd-home-window.c	2007-07-05 12:08:11 UTC (rev 12663)
@@ -1265,6 +1265,8 @@
 {
   GtkWidget    *area = GTK_BIN (window)->child;
 
+  g_debug ("Saving area layout");
+
   if (HILDON_IS_HOME_AREA (area))
     {
       GError *error = NULL;


More information about the maemo-commits mailing list