[maemo-commits] [maemo-commits] r17953 - in projects/haf/trunk/libmatchbox2: . matchbox/comp-mgr

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Apr 1 13:47:28 EEST 2009
Author: gw
Date: 2009-04-01 13:47:23 +0300 (Wed, 01 Apr 2009)
New Revision: 17953

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
Log:
        * matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c: Fix for BN#107681.
          Moved setting and unsetting a pointer to the ClutterClient from
          HD to inside the ClutterClient


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-04-01 10:18:19 UTC (rev 17952)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-04-01 10:47:23 UTC (rev 17953)
@@ -1,5 +1,11 @@
 2009-03-31  Gordon Williams  <gordon.williams at collabora.co.uk>
 
+        * matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c: Fix for BN#107681.
+          Moved setting and unsetting a pointer to the ClutterClient from
+          HD to inside the ClutterClient
+
+2009-03-31  Gordon Williams  <gordon.williams at collabora.co.uk>
+
         * matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c: Fix for NB#107323.
           It really works this time...
 

Modified: projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-04-01 10:18:19 UTC (rev 17952)
+++ projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-04-01 10:47:23 UTC (rev 17953)
@@ -268,6 +268,9 @@
   cclient->priv->actor = g_object_ref( clutter_group_new() );
   cclient->priv->bound = FALSE;
 
+  g_object_set_data (G_OBJECT (cclient->priv->actor),
+                     "HD-MBWMCompMgrClutterClient", cclient);
+
   return 1;
 }
 
@@ -278,16 +281,25 @@
   MBWMCompMgrClutterClient * cclient = MB_WM_COMP_MGR_CLUTTER_CLIENT (obj);
   MBWindowManager          * wm  = c->wm;
 
-  /* We don't need g_object_unrefs for actors, as destroy gets rid
-   * of them regardless */
+  /* We just unref our actors here and clutter will free them if required */
   if (cclient->priv->texture)
-    clutter_actor_destroy (cclient->priv->texture);
+    {
+      g_object_unref (cclient->priv->texture);
+      cclient->priv->texture = NULL;
+    }
   if (cclient->priv->actor)
     {
-      /* We want to destroy our main group, but not any children - as they
-       * may have been added by hd-decor, or hd-animation-actor */
+      /* Hildon-desktop may have set this, but we need to unset it now,
+       * because we are being destroyed */
+      g_object_set_data (G_OBJECT (cclient->priv->actor),
+                         "HD-MBWMCompMgrClutterClient", NULL);
+
+      /* If the main group gets destroyed, it destroys all children - which
+       * is not what we want, as they may have been added by hd-decor or
+       * hd-animation-actor. Instead remove all children beforehand. */
       clutter_group_remove_all(CLUTTER_GROUP(cclient->priv->actor));
-      clutter_actor_destroy (cclient->priv->actor);
+      g_object_unref (cclient->priv->actor);
+      cclient->priv->actor = NULL;
     }
 
   if (cclient->priv->window_damage)
@@ -1015,9 +1027,6 @@
    * the case of AnimationActors */
   cclient->priv->texture = g_object_ref(texture);
 
-  g_object_set_data (G_OBJECT (cclient->priv->actor),
-      "MBWMCompMgrClutterClient", cclient);
-
   /* set up our sizes and positions. Force this because it's the first
    * time we create the texture */
   mb_wm_comp_mgr_clutter_client_set_size(cclient, TRUE);


More information about the maemo-commits mailing list