Path: utzoo!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!aunro!aupair.cs.athabascau.ca!atha!decwrl!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ames!sheba.arc.nasa.gov!schoch From: schoch@trident.arc.nasa.gov (Steve Schoch) Newsgroups: comp.windows.x Subject: Re: Problem with X11R4 server `ghosting' on a 68k box. Message-ID: <1991Mar13.234049.19438@news.arc.nasa.gov> Date: 13 Mar 91 23:40:49 GMT References: <1333@amix.commodore.com> Sender: usenet@news.arc.nasa.gov (USENET Administration) Reply-To: schoch@sheba.arc.nasa.gov (Steve Schoch) Organization: NASA Ames Research Center, Moffett Field, CA Lines: 37 I have seen this problem with a server I was working on once. What happens is that rectangles can get removed from the clip lists of all windows, including the root. Once this happens, there is no way to get it back because no window "owns" that rectangle by having it as part of its cliplist. The problem turned out to be in server/ddx/mi/miregion.c. I don't know if this was fixed in later versions but I doubt it because the problem was also a problem with bcopy() from libc on this machine. The section of code is: if (prepend) { new = REGION_BOX(dstrgn, numRects); if (dnumRects == 1) *new = *REGION_BOXPTR(dstrgn); else bcopy((char *)REGION_BOXPTR(dstrgn), (char *)new, dnumRects * sizeof(BoxRec)); new = REGION_BOXPTR(dstrgn); } If you look carefully at this piece of code (which only gets called if prepend is TRUE, which isn't very often), you will see that when bcopy() is called, both REGION_PTR(dstrgn) and new point to the same buffer, but new is a higher address (new = REGION_PTR(dstrgn) + numRects). This is the only piece of code I could find in the MIT X source in which it is assumed that bcopy can handle overlapping buffers. On some machines, perhaps yours, bcopy always copies in the forward direction which will overwrite one or more rectangles in the region. If this is your problem, call ovbcopy() instead of bcopy() if you have it, or write your own ovbcopy(). Steve schoch@trident.arc.nasa.gov