Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!garfield!stretch!stretch.mun.edu!jeff1 From: jeff1@stretch.mun.edu (Jeff Sparkes) Newsgroups: comp.windows.x Subject: Re: Problem with writing in the window Message-ID: <418@stretch.MUN.EDU> Date: 1 Sep 89 11:36:14 GMT References: <3239@wasatch.utah.edu> <1752@bacchus.dec.com> Sender: jeff1@stretch.MUN.EDU Reply-To: jeff1@stretch.mun.edu (Jeff Sparkes) Organization: Memorial University of Newfoundland Lines: 26 In article <1752@bacchus.dec.com> klee@gilroy.pa.dec.com (Ken Lee) writes: In article <3239@wasatch.utah.edu>, margaret%muav.utah.edu@wasatch.utah.edu (Malgorzata Sturgill) writes: > The strange thing is that the program seems to work fine, as long as > there is no window > managerrunning ( I tried uwm and awm). This is one of the most common Xlib user errors. X is asyncronous, so there is no guarantee that your window is mapped when the XMapWindow call returns. If it is not mapped (and you are not using or do not have backing store), your drawings drop in the bit bucket. Most X programs wait for an Expose or Map event before drawing. Many just drop into an event loop after setting up their windows, with the initial Expose event being handled the same as any subsequent Expose event. The window manager also has an effect, or at least used to. I tested under twm and awm, but can't remeber which did what. One would give both events, but only after the second one could you draw. The other gave you only one event, and it was the opposite. i.e. you had to wait for an expose with one, and a map for the other. I guess (hope) this will be solved by ICCCM window managers. -- Jeff Sparkes jeff1@garfield.mun.edu || uunet!garfield!jeff1