Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!rochester!kodak!uupsi!lupine!jcb From: jcb@NCD.COM (Jim Becker) Newsgroups: comp.windows.open-look Subject: Re: GUIDE -- how to remove excessive initial repaint requests? Keywords: Guide repaint performance Message-ID: Date: 21 May 91 21:36:55 GMT References: <1991May21.140135.26869@cs.dal.ca> Lines: 53 kelley@open.dal.ca (Dan Kelley) writes: However, I'm reluctant to do the next step -- adding my own code to the Guide-generated callback functions -- because the application starts out by calling my repaint function SIX times! this is because of the number of times that XView internally resizes the windows it creates. what it does originally is create a window size 100x100, then it gets torqued to different sizes multiple times. Eventually when things settle down all the pending resize related events are processed. I'm not an X expert (that's why I'm using Guide, after all), so I wonder whether anybody out there can suggest a way around this performance killer. For example, is there some kind of countdown flag I can monitor, so I can do the repaint only the last time it's requested? yes, this is a potential performance problem. however you should not *assume* there will be five dummy calls before the final call. for the next release of XView this problem has been lessened, so you will *not* get six calls to repaint. one way to flush these events is to look into the queued events coming off the connection, and don't do a repaint unless there are no more Expose events for the window representing your canvas. this can be done by looking at the XEvents off of: struct _XSQEvent *head display->head and scanning for Expose events with matching window XID. sorry, don't have code handy to do this - but it's simple enough. (albeit not truely legal in the X world.) You can also use XPeekIfEvent() with a False returning predicate that has the side effect of setting a flag according to the exposure event presence/absence (which is a legal method, but slow). -- Dan Kelley, Oceanography Department | kelley@cs.dal.ca -Jim Becker (eX-XView group member) -- -- -Jim Becker / jcb@ncd.com / Network Computing Devices, Inc. (NCD)