[maemo-commits] [maemo-commits] r17231 - in projects/haf/trunk/libmatchbox2: . matchbox/theme-engines

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Jan 19 02:53:48 EET 2009
Author: tthurman
Date: 2009-01-19 02:53:37 +0200 (Mon, 19 Jan 2009)
New Revision: 17231

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c
Log:
	* matchbox/theme-engines/mb-wm-theme-png.c: Buttons should be
	  composited even if there's no background colour set.



Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-18 15:40:19 UTC (rev 17230)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-19 00:53:37 UTC (rev 17231)
@@ -1,5 +1,10 @@
 2009-01-18  Thomas Thurman  <thomas.thurman at collabora.co.uk>
 
+	* matchbox/theme-engines/mb-wm-theme-png.c: Buttons should be
+	  composited even if there's no background colour set.
+
+2009-01-18  Thomas Thurman  <thomas.thurman at collabora.co.uk>
+
 	* configure.ac: determine endianness
 	* matchbox/theme-engines/mb-wm-theme-png.c: PNG RGB values should
 	  be swapped on little-endian machines (e.g. the Intel scratchbox)

Modified: projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c	2009-01-18 15:40:19 UTC (rev 17230)
+++ projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c	2009-01-19 00:53:37 UTC (rev 17231)
@@ -296,7 +296,7 @@
 	   */
 	  if (d->clr_bg.set)
 	    {
-          /* Composite the decor over */
+              /* Composite the decor over */
 	      XRenderComposite (xdpy, PictOpOver,
 				p_theme->xpic,
 				None,
@@ -329,11 +329,25 @@
 				p_theme->xpic,
 				None,
 				XftDrawPicture (bdata->xftdraw_i),
-				i_x, i_y, 0, 0, 0, 0, b->width, b->height);
+				d->x + (d->width - b->width),
+                                d->y,
+                                0, 0, 0, 0, b->width, b->height);
 
 	      XRenderComposite (xdpy, PictOpSrc,
+				XftDrawPicture (bdata->xftdraw_i),
+				None,
+				XftDrawPicture (bdata->xftdraw_a),
+				0, 0, 0, 0, 0, 0, b->width, b->height);
+
+	      XRenderComposite (xdpy, PictOpOver,
 				p_theme->xpic,
 				None,
+				XftDrawPicture (bdata->xftdraw_i),
+				i_x, i_y, 0, 0, 0, 0, b->width, b->height);
+
+	      XRenderComposite (xdpy, PictOpOver,
+				p_theme->xpic,
+				None,
 				XftDrawPicture (bdata->xftdraw_a),
 				a_x, a_y, 0, 0, 0, 0, b->width, b->height);
 	    }
@@ -358,12 +372,20 @@
        * as they come up.
        */
 
-      button->geom.x =
-            XDisplayWidth (theme->wm->xdpy, theme->wm->xscreen) - b->width;
+      button->geom.x = mb_wm_decor_get_pack_end_x (decor);
       button->geom.y = 0;
       button->geom.width = b->width;
       button->geom.height = b->height;
 
+      XWindowAttributes attr;
+      XGetWindowAttributes( xdpy, decor->xwin, &attr );
+      XRenderPictFormat *format = XRenderFindVisualFormat( xdpy, attr.visual );
+      gboolean hasAlpha             = ( format->type == PictTypeDirect && format->direct.alphaMask );
+
+      /* We can't use PictOpOver because the target window
+       * doesn't have an alpha channel
+       */
+
       XRenderComposite (xdpy, PictOpSrc,
 			button->state == MBWMDecorButtonStatePressed ?
 			XftDrawPicture (bdata->xftdraw_a) :


More information about the maemo-commits mailing list