Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!TUB.BITNET!net From: net@TUB.BITNET (Oliver Laumann) Newsgroups: comp.windows.x Subject: Bug? Message-ID: <8805291924.AA16344@tub.UUCP> Date: 29 May 88 19:24:18 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 51 Maybe I'm just dumb today, but it seems the result returned by XGetWindowAttributes() is not deterministic. The small program attached to this letter demonstrates the problem. After having invoked the program under uwm, I position the window to a non-zero x-coordinate (say, 600). The printf near the end of the program sometimes (one out of ten times) prints the old x value (600 in this case), although the window has been repositioned by the call to XConfigureWindow(). I'm using X Windows Version 11 Release 2; the server is running on a Sun 3/50 and the client on a Sun 3/260. Here is the offending program: #include #include main () $ Display *d; Window w; XSetWindowAttributes swa; XWindowChanges wc; XWindowAttributes wa; XEvent e; if ((d = XOpenDisplay ((char *)0)) == 0) exit (1); swa.background_pixel = WhitePixel (d, DefaultScreen (d)); swa.border_pixel = BlackPixel (d, DefaultScreen (d)); swa.event_mask = ExposureMask|EnterWindowMask|LeaveWindowMask; w = XCreateWindow (d, DefaultRootWindow (d), 0, 0, 400, 400, 2, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWBorderPixel|CWEventMask, &swa); XMapWindow (d, w); do $ XNextEvent (d, &e); while (e.type != Expose); wc.x = 0; XConfigureWindow (d, w, CWX, &wc); XGetWindowAttributes (d, w, &wa); printf ("x = %d\n", wa.x); pause (); Thanks in advance for any help. -- Regards, Oliver Laumann, Technical University of Berlin, Germany. ...!pyramid!tub!net or net@TUB.BITNET ...!mcvax!unido!tub!net