Hello,

It appears the tiny attached program crashes Xnest if the line


        #if 0 /* halve width */

is changed to

        #if 1 /* halve width */


Basically then it Xft-paints text beyond 'bounding-area' of XShape.

In contrast, this program doesn't crash Xnest 1.2 and 1.3.


Greetings,

    Eeri Kask


P.S. To prove it is XftDrawString8() problem please change

        #if 1   /* enable/disable exposures */

to

        #if 0   /* enable/disable exposures */


few lines below and rerun.

/*
    gcc -o textbitmapshape_bugdemo TextBitmapShape_BugDemo.c -lX11 -lXext -lXft 
 -L/usr/X11R6/lib -I/usr/X11R6/include -I/usr/X11R6/include/freetype2
*/

#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
#include <X11/extensions/shape.h>

main (int argc, char **argv)
{
    char * str = (argc>1?argv[1]:"Lorem ipsum");

    Display * dsp = XOpenDisplay (NULL);
    int scr = XDefaultScreen (dsp);

    Window win = XCreateSimpleWindow (dsp, XRootWindow (dsp, scr), 5, 5, 300, 
100, 3,
                                        XBlackPixel (dsp, scr), XWhitePixel 
(dsp, scr));
    XRectangle rec;
    rec.x = rec.y = 0;
    rec.width = 300, rec.height = 100;
#if 0 /* halve width */
    rec.width -= 150;
#endif
    XShapeCombineRectangles (dsp, win, ShapeBounding, 0, 0, &rec, 1, ShapeSet, 
Unsorted);

    XftColor xft_col;
    XftColorAllocName (dsp, XDefaultVisual (dsp, scr), XDefaultColormap (dsp, 
scr), "SeaGreen", &xft_col);
    XftFont * font = XftFontOpenName (dsp, scr, 
"serif:bold:italic:pixelsize=33");
    XftDraw * draw = XftDrawCreate (dsp, win, XDefaultVisual (dsp, scr), 
XDefaultColormap (dsp, scr));

    XSelectInput (dsp, win, ExposureMask);
    XMapWindow (dsp, win);

    for (;;)
    {
        XEvent evt;
        XNextEvent (dsp, &evt);
#if 1   /* enable/disable exposures */
        if (evt.type == Expose)
            XftDrawString8 (draw, &xft_col, font, 20, 60, (XftChar8*)(str), 
strlen(str));
#endif
    }
}
_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to