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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Apr 14 18:14:18 EEST 2009
Author: gw
Date: 2009-04-14 18:14:16 +0300 (Tue, 14 Apr 2009)
New Revision: 18062

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 NB#108826 (other
	mods in hildon-desktop). Add a check to see if the top bit of the
	width or height is set, and if so set to 0 so we don't have 2^32 wide
	clutter actors when we have negative window sizes.


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-04-14 13:53:24 UTC (rev 18061)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-04-14 15:14:16 UTC (rev 18062)
@@ -1,3 +1,10 @@
+2009-04-14  Gordon Williams  <gordon.williams at collabora.co.uk>
+
+	* matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c: Fix for NB#108826 (other
+	mods in hildon-desktop). Add a check to see if the top bit of the
+	width or height is set, and if so set to 0 so we don't have 2^32 wide
+	clutter actors when we have negative window sizes.
+
 2009-04-14  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	Release 0.2.32

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-14 13:53:24 UTC (rev 18061)
+++ projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-04-14 15:14:16 UTC (rev 18062)
@@ -129,6 +129,13 @@
 
   int position = !(cclient->priv->flags & MBWMCompMgrClutterClientDontPosition) | force;
 
+  MBGeometry geomw = client->wm_client->window->geometry;
+  /* make sure that if sizes were negative, we make them zero */
+  if (geomw.width & 0x8000000)
+    geomw.width = 0;
+  if (geomw.height & 0x8000000)
+    geomw.height = 0;
+
   /* We have 2 types - either we have a frame,
    * or we don't. The texture sits inside our parent actor */
   if (client->wm_client->xwin_frame)
@@ -137,7 +144,12 @@
        * So we treat our parent 'actor' as the frame and offset the
        * X window in it */
       MBGeometry geomf = client->wm_client->frame_geometry;
-      MBGeometry geomw = client->wm_client->window->geometry;
+      /* make sure that if sizes were negative, we make them zero */
+      if (geomf.width & 0x8000000)
+        geomf.width = 0;
+      if (geomf.height & 0x8000000)
+        geomf.height = 0;
+
       if (position)
         clutter_actor_set_position (actor, geomf.x, geomf.y);
       clutter_actor_set_size (actor, geomf.width, geomf.height);
@@ -154,15 +166,14 @@
     {
       /* We're not in a frame - it's easy. Make the texture and actor
        * the same size */
-      MBGeometry geom = client->wm_client->window->geometry;
       if (position)
-        clutter_actor_set_position (actor, geom.x, geom.y);
-      clutter_actor_set_size (actor, geom.width, geom.height);
+        clutter_actor_set_position (actor, geomw.x, geomw.y);
+      clutter_actor_set_size (actor, geomw.width, geomw.height);
 
       if (texture)
         {
           clutter_actor_set_position (texture, 0, 0);
-          clutter_actor_set_size (texture, geom.width, geom.height);
+          clutter_actor_set_size (texture, geomw.width, geomw.height);
         }
     }
 }


More information about the maemo-commits mailing list