X11: event window and rendering window differ, how to work around this?

It seems like SDL creates two different windows, one to receive
(key-)events and one to render the data to. Unfortunately this breaks my
little application which hooks all XEvent functions and when the user
presses a predefined key combination, it saves the dpy/win and starts
capturing from the window: when the app calls glXSwapBuffers, it checks
if the user has enabled capturing and saves the image (glReadPixels).
But because the ‘win’ arguments differ, glXSwapBuffers never finds out
that the user activated the capturing. I can work around this by
’overriding’ the events and simply capture everything that the
application calls glXSwapBuffers on, but that isn’t very elegant as the
user can’t stop capturing and needs to exit/restart the application.

Does anyone have an idea how I could work around this, preferably
without having to hook a SDL function?

thanks
tom

Tomas Carnecky wrote:

Does anyone have an idea how I could work around this, preferably
without having to hook a SDL function?

Not having SDL support is very… unfortunate. My neat little application
is the only one (AFAIK) that can reasonably well capture 3D applications
(=games). All other tools that I know use XShm or just plain X11 which
is much slower that OpenGL (glReadPixels).
If you want to test it, here’s the ‘homepage’:
http://www.neopsis.com/projects/yukon/ - nothing great but still better
than nothing. I also have some videos, many of them are quite big, but I
also found a small one, 13MB:
http://dbservice.com/ftpdir/tom/Naxxramas-AoE.mp4, you must excuse me
but World of Warcraft is the only game I play and also the only one I
capture. Sometimes I also test my application with Quake3 (works great)
and foobillard (uses SDL and has the said problem).

Although SDL isn’t my biggest problem ATM (I don’t know any ‘good’ games
that use it), it’s certainly worth fixing. There are also applications
that open libGL.so directly and don’t even let me hook glXSwapBuffers
(like cedega) but I can always replace libGL.so with my version like
it’s done in the many linux game-hacks.

I hope someone will be able to help me.
tom