[maemo-commits] [maemo-commits] r17268 - in projects/haf/trunk/libmatchbox2: . matchbox/core

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jan 23 12:57:19 EET 2009
Author: aendrodi
Date: 2009-01-23 12:57:12 +0200 (Fri, 23 Jan 2009)
New Revision: 17268

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c
Log:
	* matchbox/core/mb-wm-decor.c:
	  Don't attempt to create 0-width decor windows.
	  Destroy the decor's XWindow along with the object.


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-23 09:48:23 UTC (rev 17267)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-23 10:57:12 UTC (rev 17268)
@@ -1,3 +1,9 @@
+2009-01-23  Adam Endrodi  <adam.endrodi at blumsoft.eu>
+
+	* matchbox/core/mb-wm-decor.c:
+	  Don't attempt to create 0-width decor windows.
+	  Destroy the decor's XWindow along with the object.
+
 2009-01-23  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	Patch from Laszlo:

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c	2009-01-23 09:48:23 UTC (rev 17267)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c	2009-01-23 10:57:12 UTC (rev 17268)
@@ -334,6 +334,11 @@
 
   if (decor->xwin == None)
     {
+      if (!decor->geom.width || !decor->geom.height)
+        /* Don't bother creating 1-dimension windows, X would reject it
+         * anyway, but we wouldn't notice the error. */
+        return False;
+
       attr.override_redirect = True;
       /*attr.background_pixel  = WhitePixel(wm->xdpy, wm->xscreen);*/
       attr.background_pixmap = None;
@@ -675,6 +680,13 @@
 					       decor->press_cb_id);
     decor->press_cb_id = 0;
   }
+
+  if (decor->xwin != None)
+    {
+      mb_wm_util_trap_x_errors();
+      XDestroyWindow (decor->parent_client->wmref->xdpy, decor->xwin);
+      mb_wm_util_untrap_x_errors();
+    }
 }
 
 void


More information about the maemo-commits mailing list