Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!ASC.SLB.COM!hara From: hara@ASC.SLB.COM Newsgroups: comp.windows.x Subject: Re: Does XUI support dual screen? Message-ID: <9010230144.AA11585.hara@ika.ASC.SLB.COM> Date: 23 Oct 90 01:44:42 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 49 I think I find the bug in XUI code,i.e., ------------------- GCManager.c file -------------------- .... static Drawable GCparents[256]; /* static initialized to zero, K&R ss 4.9 */ .... GC XtGetGC(widget, valueMask, values) Widget widget; register XtGCMask valueMask; XGCValues *values; { .... if (XtWindow(widget) == NULL) { /* Have to create a bogus pixmap for the GC. Stupid X protocol. */ if (GCparents[depth] != 0) { drawable = GCparents[depth]; <--- [0] } else { if (depth == DefaultDepthOfScreen(screen)) drawable = RootWindowOfScreen(screen); else drawable = XCreatePixmap(cur->dpy, screen->root, 1, 1, depth); GCparents[depth] = drawable; } } else { drawable = XtWindow(widget); } cur->gc = XCreateGC(cur->dpy, drawable, valueMask, values); <--- [1] ...... ---------------------------------------------------------------------- The program breaks at [1] with "Bad Match" error, and if you look at the staic variable GCparents, it's shared if "widget" has the same depth. And here is the problem, i.e., if a widget which has the different root window as before (in our case "depth" is always 8) is created, the same "same" drawable will be sent to XCreateGC. Is this already fixed? If so, can I get it? If not, I'll fix it here. B.T.W., the last update of our GCManager.c file was done Feb/27/'88. Thanks much, Kenzo HARA hara@asc.slb.com