[arch-commits] Commit in xchat/trunk (3 files)

Eric Bélanger eric at archlinux.org
Mon Sep 28 05:45:44 UTC 2009


    Date: Monday, September 28, 2009 @ 01:45:44
  Author: eric
Revision: 53308

upgpkg: xchat 2.8.6-4
    Fixed crash when transparent background is enabled (close FS#15360)

Added:
  xchat/trunk/xchat-2.8.4-shm-pixmaps.patch
Modified:
  xchat/trunk/ChangeLog
  xchat/trunk/PKGBUILD

-------------------------------+
 ChangeLog                     |    5 +
 PKGBUILD                      |   19 +++----
 xchat-2.8.4-shm-pixmaps.patch |  106 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 120 insertions(+), 10 deletions(-)

Modified: ChangeLog
===================================================================
--- ChangeLog	2009-09-28 02:13:52 UTC (rev 53307)
+++ ChangeLog	2009-09-28 05:45:44 UTC (rev 53308)
@@ -1,3 +1,8 @@
+2009-09-28  Eric Belanger  <eric at archlinux.org>
+
+	* xchat 2.8.6-4
+	* Fixed crash when transparent background is enabled (close FS#15360) 
+
 2008-11-08  Eric Belanger  <eric at archlinux.org>
 
 	* xchat 2.8.6-3

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-09-28 02:13:52 UTC (rev 53307)
+++ PKGBUILD	2009-09-28 05:45:44 UTC (rev 53308)
@@ -3,7 +3,7 @@
 
 pkgname=xchat
 pkgver=2.8.6
-pkgrel=3
+pkgrel=4
 pkgdesc="A GTK+ based IRC client"
 arch=('i686' 'x86_64')
 url="http://www.xchat.org/"
@@ -14,23 +14,22 @@
 options=('!libtool')
 source=(http://www.xchat.org/files/source/${pkgver%.*}/${pkgname}-${pkgver}.tar.bz2 \
         http://www.xchat.org/files/source/2.8/patches/xc286-smallfixes.diff
-        xchat-gtk2.patch)
-md5sums=('1f2670865d43a23a9abc596dde999aca' 
-         'eb68b6261bf6740cb5f223627eb8f384'
-         'f3fe00982c0bec93152ed0b32438ef87')
-sha1sums=('7a7463e65cb26c680ed70dd96cec98bcc05435a4'
-          'b13eb421f6d72fca195b398c606d9413aec57fc4'
-          'cf9c5d93af262474e0855f2965210a4a3600acc7')
+        xchat-gtk2.patch xchat-2.8.4-shm-pixmaps.patch)
+md5sums=('1f2670865d43a23a9abc596dde999aca' 'eb68b6261bf6740cb5f223627eb8f384'\
+         'f3fe00982c0bec93152ed0b32438ef87' 'a0b3889d160ddf21eebd25b645bd1e48')
+sha1sums=('7a7463e65cb26c680ed70dd96cec98bcc05435a4' 'b13eb421f6d72fca195b398c606d9413aec57fc4'\
+         'cf9c5d93af262474e0855f2965210a4a3600acc7' '7647815270fac1a58109cb3b4000bc9187871399')
 
 build() {
-  cd ${srcdir}/${pkgname}-${pkgver}
+  cd "${srcdir}/${pkgname}-${pkgver}"
   patch -p1 < ../xc286-smallfixes.diff || return 1
   patch -p1 < ../xchat-gtk2.patch || return 1
+  patch -p1 < ../xchat-2.8.4-shm-pixmaps.patch || return 1
   ./configure --prefix=/usr --sysconfdir=/etc \
               --enable-openssl --enable-dbus \
               --disable-gnome --disable-textfe \
 	      --enable-ipv6 --enable-shm \
 	      --enable-spell=static || return 1
   make || return 1
-  make DESTDIR=${pkgdir} install || return 1
+  make DESTDIR="${pkgdir}" install || return 1
 }

Added: xchat-2.8.4-shm-pixmaps.patch
===================================================================
--- xchat-2.8.4-shm-pixmaps.patch	                        (rev 0)
+++ xchat-2.8.4-shm-pixmaps.patch	2009-09-28 05:45:44 UTC (rev 53308)
@@ -0,0 +1,106 @@
+diff -ur xchat-2.8.4/src/fe-gtk/xtext.c xchat-2.8.4-shm-pixmaps/src/fe-gtk/xtext.c
+--- xchat-2.8.4/src/fe-gtk/xtext.c	2007-06-08 11:57:07.000000000 +0200
++++ xchat-2.8.4-shm-pixmaps/src/fe-gtk/xtext.c	2008-05-23 00:56:52.000000000 +0200
+@@ -1347,6 +1347,22 @@
+ 	}
+ }
+ 
++#ifdef USE_SHM
++static int
++have_shm_pixmaps(Display *dpy)
++{
++    static int checked = 0, major, minor;
++    static Bool have = FALSE;
++
++    if (!checked) {
++	XShmQueryVersion(dpy, &major, &minor, &have);
++	checked = 1;
++    }
++
++    return have;
++}
++#endif
++
+ static void
+ gtk_xtext_paint (GtkWidget *widget, GdkRectangle *area)
+ {
+@@ -1363,8 +1379,12 @@
+ 		{
+ 			xtext->last_win_x = x;
+ 			xtext->last_win_y = y;
+-#if !defined(USE_SHM) && !defined(WIN32)
++#ifndef WIN32
++#ifdef USE_SHM
++			if (xtext->shaded && !have_shm_pixmaps(GDK_WINDOW_XDISPLAY (xtext->draw_buf)))
++#else
+ 			if (xtext->shaded)
++#endif
+ 			{
+ 				xtext->recycle = TRUE;
+ 				gtk_xtext_load_trans (xtext);
+@@ -3549,6 +3569,11 @@
+ 	GC tgc;
+ 	Display *xdisplay = GDK_WINDOW_XDISPLAY (xtext->draw_buf);
+ 
++#ifdef USE_SHM
++	int shm_pixmaps;
++	shm_pixmaps = have_shm_pixmaps(xdisplay);
++#endif
++
+ 	XGetGeometry (xdisplay, p, &root, &dummy, &dummy, &width, &height,
+ 					  &dummy, &depth);
+ 
+@@ -3566,18 +3591,20 @@
+ 		XFreeGC (xdisplay, tgc);
+ 
+ #ifdef USE_SHM
+-		ximg = get_image (xtext, xdisplay, &xtext->shminfo, 0, 0, w, h, depth, tmp);
+-#else
+-		ximg = XGetImage (xdisplay, tmp, 0, 0, w, h, -1, ZPixmap);
++		if (shm_pixmaps)
++			ximg = get_image (xtext, xdisplay, &xtext->shminfo, 0, 0, w, h, depth, tmp);
++		else
+ #endif
++			ximg = XGetImage (xdisplay, tmp, 0, 0, w, h, -1, ZPixmap);
+ 		XFreePixmap (xdisplay, tmp);
+ 	} else
+ 	{
+ #ifdef USE_SHM
+-		ximg = get_image (xtext, xdisplay, &xtext->shminfo, x, y, w, h, depth, p);
+-#else
+-		ximg = XGetImage (xdisplay, p, x, y, w, h, -1, ZPixmap);
++		if (shm_pixmaps)
++			ximg = get_image (xtext, xdisplay, &xtext->shminfo, x, y, w, h, depth, p);
++		else
+ #endif
++			ximg = XGetImage (xdisplay, p, x, y, w, h, -1, ZPixmap);
+ 	}
+ 
+ 	if (!ximg)
+@@ -3602,7 +3629,7 @@
+ 	else
+ 	{
+ #ifdef USE_SHM
+-		if (xtext->shm)
++		if (xtext->shm && shm_pixmaps)
+ 		{
+ #if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0)
+ 			shaded_pix = gdk_pixmap_foreign_new (
+@@ -3620,7 +3647,7 @@
+ 	}
+ 
+ #ifdef USE_SHM
+-	if (!xtext->shm)
++	if (!xtext->shm || !shm_pixmaps)
+ #endif
+ 		XPutImage (xdisplay, GDK_WINDOW_XWINDOW (shaded_pix),
+ 					  GDK_GC_XGC (xtext->fgc), ximg, 0, 0, 0, 0, w, h);
+@@ -3640,7 +3667,7 @@
+ 	if (xtext->pixmap)
+ 	{
+ #ifdef USE_SHM
+-		if (xtext->shm)
++		if (xtext->shm && have_shm_pixmaps(GDK_WINDOW_XDISPLAY (xtext->draw_buf)))
+ 		{
+ 			XFreePixmap (GDK_WINDOW_XDISPLAY (xtext->pixmap),
+ 							 GDK_WINDOW_XWINDOW (xtext->pixmap));




More information about the arch-commits mailing list