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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon May 18 10:40:53 EEST 2009
Author: kihamala
Date: 2009-05-18 10:40:48 +0300 (Mon, 18 May 2009)
New Revision: 18404

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
Log:
trap the crap!


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-05-18 07:38:57 UTC (rev 18403)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-05-18 07:40:48 UTC (rev 18404)
@@ -1,3 +1,16 @@
+2009-05-18  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
+
+	* matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
+	(mb_wm_comp_mgr_clutter_client_destroy): Set window_damage to NULL
+	after destroying it.
+	(mb_wm_comp_mgr_clutter_handle_damage): Trap X error in absense of a
+	better fix. Fixes: NB#116072
+
+	* matchbox/core/mb-wm-client-window.c
+	(mb_wm_client_window_sync_properties): Trap X errors coming during
+	XSync call. Those often come when toggling 'offline mode' in power
+	menu.
+
 2009-05-15  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	Patch from Laszlo Pere to fix NB#103219:

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-05-18 07:38:57 UTC (rev 18403)
+++ projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-05-18 07:40:48 UTC (rev 18404)
@@ -337,6 +337,7 @@
       if ((err = mb_wm_util_untrap_x_errors()) != 0)
         g_debug ("XDamageDestroy(0x%lx) for %p: %d",
                  cclient->priv->window_damage, c, err);
+      cclient->priv->window_damage = 0;
     }
 
   free (cclient->priv);
@@ -809,6 +810,7 @@
     {
       MBWMCompMgrClutterClient *cclient =
 	MB_WM_COMP_MGR_CLUTTER_CLIENT (c->cm_client);
+      int err;
 
 /* We ignore the DontUpdate flag for i386, as it uses the X11 Texture Pixmap
  * class, which requires damage events to keep its internal texture in sync.
@@ -839,7 +841,12 @@
        */
       damage = cclient->priv->window_damage;
 
+      /* FIXME: As Adam said, reason for this X error should be discovered
+       * and avoided */
+      mb_wm_util_trap_x_errors ();
       mb_wm_comp_mgr_clutter_client_repair_real (c->cm_client, damage);
+      if ((err = mb_wm_util_untrap_x_errors ()))
+        g_warning ("%s: X error %d", __func__, err);
     }
   else
     {

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-05-18 07:38:57 UTC (rev 18403)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-05-18 07:40:48 UTC (rev 18404)
@@ -351,8 +351,15 @@
 	  	wm->atoms[MBWM_ATOM_HILDON_STACKING_LAYER]);
     }
 
-  /* bundle all pending requests to server and wait for replys */
-  XSync(wm->xdpy, False);
+  {
+    int err;
+    /* FIXME: toggling 'offline' mode in power menu can cause X error here */
+    mb_wm_util_trap_x_errors ();
+    /* bundle all pending requests to server and wait for replys */
+    XSync(wm->xdpy, False);
+    if ((err = mb_wm_util_untrap_x_errors ()))
+      g_warning ("%s: X error %d", __func__, err);
+  }
 
   if (props_req & MBWM_WINDOW_PROP_TRANSIENCY)
     {


More information about the maemo-commits mailing list