Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!INTELLICORP.COM!TRANLE From: TRANLE@INTELLICORP.COM (Minh Tran-Le) Newsgroups: comp.windows.x Subject: problem with XDrawImageString to pixmap on the PS2 AIX server Message-ID: <9003210235.AA09058@expo.lcs.mit.edu> Date: 16 Mar 90 20:05:17 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 69 I am using the R4 server on the PS2 running AIX and the following code does not seem to work correctly. Does anybody has a fix or workaround for it ? Thanks, Minh Tran-Le Arpanet: tranle@intellicorp.com uucp: ..sun!icmv!mtranle /* ------------------------------------------------------------------------- */ #include #include #include #include #include /* * This small program reproduce a bug in the IBM PS2 X server: * when you use XDrawImageString to a pixmap the server * will write directly to the screen. * * to compile it: * cc -o xbug xbug.c -lX11 */ main() { Display *dpy; int screen; GC gc; Pixmap pix; Window w; XGCValues xgcv; XSetWindowAttributes xswa; char *str = "This is the string to print"; dpy = XOpenDisplay(""); screen = DefaultScreen(dpy); pix = XCreatePixmap(dpy, RootWindow(dpy, screen), 100, 100, /* width and height */ 8); /* depth */ xgcv.foreground = BlackPixel(dpy,screen); xgcv.background = WhitePixel(dpy,screen); gc = XCreateGC(dpy, pix, GCForeground|GCBackground, &xgcv); /* * write the string to the pixmap at 20,20 */ XDrawImageString(dpy, pix, gc, 20, 20, str, strlen(str)); /* flush output queue */ XSync(dpy,False); printf("You should not have seen anything written on your screen\n"); sleep(5); exit(0); } /* ------------------------------------------------------------------------- */ -------