dana@THUMPER.BELLCORE.COM (Dana A. Chee) (06/14/88)
Stats: Sun 3/160C, Sun 3.5, X11R2 Run the program below on both a monochrome and a color sun, on a monochrome sun, the Ace is complete starting at 0,0 in the window, but on the color sun, it is offset as if the graphics context had ts_x_origin and ts_y_origin set to something other than 0,0. Question is, am I missing something, is this a known bug (with a known fix) and is this a problems on other color workstations other than Suns. Dana Chee Bellcore MRE 2Q-250 (201) 829-4488 dana@bellcore.com ==================== #include <X11/Xlib.h> #include <X11/StringDefs.h> #include <X11/IntrinsicP.h> #define card_width 40 #define card_height 60 static char card_bits[] = { /* Ace of Hearts */ 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x41, 0x00, 0x00, 0x00, 0x80, 0xa1, 0x00, 0x00, 0x00, 0x80, 0x11, 0x01, 0x00, 0x00, 0x80, 0x11, 0x01, 0x00, 0x00, 0x80, 0x11, 0x01, 0x00, 0x00, 0x80, 0xf1, 0x01, 0x00, 0x00, 0x80, 0x11, 0x01, 0x00, 0x00, 0x80, 0x19, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0xb1, 0x01, 0x00, 0x00, 0x80, 0xf9, 0x03, 0x00, 0x00, 0x80, 0xf9, 0x03, 0x00, 0x00, 0x80, 0xf9, 0x03, 0x00, 0x00, 0x80, 0xf1, 0x01, 0x00, 0x00, 0x80, 0xe1, 0x00, 0x00, 0x00, 0x80, 0x41, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0xe3, 0x01, 0x80, 0x01, 0xe0, 0xf7, 0x03, 0x80, 0x01, 0xf0, 0xff, 0x07, 0x80, 0x01, 0xf0, 0xff, 0x07, 0x80, 0x01, 0xf0, 0xff, 0x07, 0x80, 0x01, 0xf0, 0xff, 0x07, 0x80, 0x01, 0xe0, 0xff, 0x03, 0x80, 0x01, 0xc0, 0xff, 0x01, 0x80, 0x01, 0x80, 0xff, 0x00, 0x80, 0x01, 0x00, 0x7f, 0x00, 0x80, 0x01, 0x00, 0x3e, 0x00, 0x80, 0x01, 0x00, 0x1c, 0x00, 0x80, 0x01, 0x00, 0x08, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x8d, 0x01, 0x00, 0x00, 0xc0, 0x9f, 0x01, 0x00, 0x00, 0xc0, 0x9f, 0x01, 0x00, 0x00, 0xc0, 0x9f, 0x01, 0x00, 0x00, 0x80, 0x8f, 0x01, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x80, 0x88, 0x01, 0x00, 0x00, 0x80, 0x88, 0x01, 0x00, 0x00, 0x80, 0x88, 0x01, 0x00, 0x00, 0x80, 0x8f, 0x01, 0x00, 0x00, 0x80, 0x88, 0x01, 0x00, 0x00, 0xc0, 0x98, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff }; main() { Display *dpy; Window win; int screen, depth; XtGCMask valuemask; XGCValues xgcv; Pixmap pp; GC newgc; XEvent ev; XSetWindowAttributes attrs; dpy = XOpenDisplay(0); screen = DefaultScreen(dpy); depth = DefaultDepth(dpy, screen); win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 20, 20, 100, 100, 3, BlackPixel(dpy, screen), WhitePixel(dpy, screen)); attrs.event_mask = ExposureMask; XChangeWindowAttributes(dpy, win, CWEventMask, &attrs); pp = XCreatePixmapFromBitmapData(dpy, win, card_bits, card_width, card_height, BlackPixel(dpy, screen), WhitePixel(dpy, screen), depth); valuemask = GCTile | GCFillStyle; xgcv.tile = pp; xgcv.fill_style = FillTiled; newgc = XCreateGC(dpy, win, valuemask, &xgcv); XMapWindow(dpy, win); XNextEvent(dpy, &ev); XFillRectangle(dpy, win, newgc, 0, 0, 100, 100); while(1) { XNextEvent(dpy, &ev); printf("Event is %x\n", ev.type); } }