Expose performance


I wonder if there is any quick way to make handleWindowMessage/Expose faster? Like it is now, it seems to repaint everything, which is not allways necessary.

When switching between several virtual screens, which is common in X, it is nice if it the windows redraw as fast as possible.

I have tried to make some hacks to speed up, though, but I don’t understand the code enough to make anything reliable.

I haven’t tried the simplest approach though, allocating one large XImage per window, and just blit to that one. But I was hoping to avoid that, although even that approach could be better than now. I think at least it should be an option unless other and better solutions are possible.


Seems like that’d involve using a lot of memory just to speed it up a bit when you switch screens… It depends what you’re drawing, too - if a window’s contents are quite simple then buffering it won’t help much anyway.


Yes, the program I’m working on now use approx 1/2 second to redraw. Its a bit annoying only.

But is it really necessary with an increase in memory usage? Seems like at least one of the allocated XBitImages is allways the size of the window?


The cached images get deleted after a few seconds, and don’t always cover the whole window - if just a small area is changing, it’ll keep the image size down to a minimum.