1 diff -ruN xchat-2.8.6.orig/src/fe-gtk/xtext.c xchat-2.8.6/src/fe-gtk/xtext.c
2 --- xchat-2.8.6.orig/src/fe-gtk/xtext.c 2008-02-24 06:04:30.000000000 +0100
3 +++ xchat-2.8.6/src/fe-gtk/xtext.c 2008-10-14 11:04:57.000000000 +0200
10 +have_shm_pixmaps(Display *dpy)
12 + static int checked = 0, major, minor;
13 + static Bool have = FALSE;
16 + XShmQueryVersion(dpy, &major, &minor, &have);
25 gtk_xtext_paint (GtkWidget *widget, GdkRectangle *area)
27 @@ -1366,8 +1382,12 @@
29 xtext->last_win_x = x;
30 xtext->last_win_y = y;
31 -#if !defined(USE_SHM) && !defined(WIN32)
34 + if (xtext->shaded && !have_shm_pixmaps(GDK_WINDOW_XDISPLAY (xtext->draw_buf)))
39 xtext->recycle = TRUE;
40 gtk_xtext_load_trans (xtext);
41 @@ -3559,6 +3579,11 @@
43 Display *xdisplay = GDK_WINDOW_XDISPLAY (xtext->draw_buf);
47 + shm_pixmaps = have_shm_pixmaps(xdisplay);
50 XGetGeometry (xdisplay, p, &root, &dummy, &dummy, &width, &height,
53 @@ -3576,18 +3601,20 @@
54 XFreeGC (xdisplay, tgc);
57 - ximg = get_image (xtext, xdisplay, &xtext->shminfo, 0, 0, w, h, depth, tmp);
59 - ximg = XGetImage (xdisplay, tmp, 0, 0, w, h, -1, ZPixmap);
61 + ximg = get_image (xtext, xdisplay, &xtext->shminfo, 0, 0, w, h, depth, tmp);
64 + ximg = XGetImage (xdisplay, tmp, 0, 0, w, h, -1, ZPixmap);
65 XFreePixmap (xdisplay, tmp);
69 - ximg = get_image (xtext, xdisplay, &xtext->shminfo, x, y, w, h, depth, p);
71 - ximg = XGetImage (xdisplay, p, x, y, w, h, -1, ZPixmap);
73 + ximg = get_image (xtext, xdisplay, &xtext->shminfo, x, y, w, h, depth, p);
76 + ximg = XGetImage (xdisplay, p, x, y, w, h, -1, ZPixmap);
85 + if (xtext->shm && shm_pixmaps)
87 #if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0)
88 shaded_pix = gdk_pixmap_foreign_new (
94 + if (!xtext->shm || !shm_pixmaps)
96 XPutImage (xdisplay, GDK_WINDOW_XWINDOW (shaded_pix),
97 GDK_GC_XGC (xtext->fgc), ximg, 0, 0, 0, 0, w, h);
103 + if (xtext->shm && have_shm_pixmaps(GDK_WINDOW_XDISPLAY (xtext->draw_buf)))
105 XFreePixmap (GDK_WINDOW_XDISPLAY (xtext->pixmap),
106 GDK_WINDOW_XWINDOW (xtext->pixmap));