Re: [gtk-list] GDK_NO_EXPOSE





On Wed, 7 Jan 1998, Owen Taylor wrote:

> As for the VISIBILITY_NOTIFY event which was added at the
> same time - I'm curious as to what it is used for. (I guess
> I'll have to take a look at the HTML widget to find out)

This is a fairly neat hack used by XmHTML. This widget uses a fairly neat 
trick for scrolling with XCopyArea even in the presence of embedded 
windows. It does the copy in such a way as to move the contents of the 
child windows as well, then moves the child windows (I think) without 
doing anything on the screen. The only problem is that you still get 
bogus GraphicsExpose events. If the window is fully visible, then it's 
possible to safely discard GraphicsExpose events. If the window is 
partially obscured, then you get both legitimate and bogus GraphicsExpose 
events. Since it's difficult to tell the two apart, you just draw them 
both, at the cost of a little extra redrawing in the case of both 
embedded windows and a partially obscured window.

Note that there shouldn't be any race conditions because both the 
visibility notification and the GraphicsExpose events come from the 
server. Thus, I think it's possible to use this trick and still get 
absolutely correct behavior.

I think this may be a good hack to use in Gtk. I would really like to be 
able to use XCopyArea instead of XMoveWindow - using the latter function 
makes us wait for the expose event to come back before filling in the 
region that scrolls into visibility. Actually, the situation is quite a 
bit worse than that in Gzilla 0.1.5 and Gtk 0.99.2, because the expose 
isn't actually processed until an idle cycle, so that the expose events 
can be aggregated. Thus, if you scroll smoothly but slowly, all the 
cycles can get chewed up with small-delta XMoveWindow requests, stalling 
the idle cycle. It's definitely possible to do better. The easy way, I 
think, would be to also defer the XMoveWindow call to an idle function. 
To get it really right, though, may require some changes to Gtk to 
aggregate the expose events inside the Gtk main loop.

Hope this was illuminating.

Raph



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]