I kept seeing DGA die on me whenever I press a key.
I tracked it down and it seems that the new indirect X via pointers
system messed it up. It needed to have the pX* pointers well defined to
call, in particular, pXNextEvent. Also, the X11_TranslateKey function
prototype was changed, but not updated in the dga driver. perhaps other
files are also affected.
Not sure what releases may suffer from this too.
thanks!
-Jon Atkins
here’s the patch below:
Index: src/video/dga/SDL_dgaevents.c===================================================================
RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/dga/SDL_dgaevents.c,v
retrieving revision 1.8
diff -u -b -B -r1.8 SDL_dgaevents.c
— src/video/dga/SDL_dgaevents.c 5 Nov 2005 19:53:36 -0000 1.8
+++ src/video/dga/SDL_dgaevents.c 5 Dec 2005 02:26:23 -0000
@@ -36,10 +36,13 @@
#include “SDL_dgavideo.h”
#include “SDL_dgaevents_c.h”
+/* get function pointers… /
+#include “…/x11/SDL_x11dyn.h”
+
/ Heheh we’re using X11 event code */
extern int X11_Pending(Display *display);
extern void X11_InitKeymap(void);
-extern SDL_keysym *X11_TranslateKey(Display *display, XKeyEvent *xkey,
+extern SDL_keysym *X11_TranslateKey(Display *display, XIC ic, XKeyEvent
*xkey,
KeyCode kc, SDL_keysym *keysym);
static int DGA_DispatchEvent(_THIS)
@@ -84,7 +87,7 @@
SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey);
posted = SDL_PrivateKeyboard((xevent.type == KeyPress),
-
X11_TranslateKey(DGA_Display,
-
X11_TranslateKey(DGA_Display,
NULL/no XIC/,
&xkey,
xkey.keycode,
&keysym));
}