Date: Sun, 04 Dec 2005 21:43:46 -0500
authorRyan C. Gordon <icculus@icculus.org>
Mon, 05 Dec 2005 04:36:53 +0000
changeset 1194b8f167923bfc
parent 1193 3bafdbba8dcf
child 1195 bb6791b0a268
Date: Sun, 04 Dec 2005 21:43:46 -0500
From: Jonathan Atkins <jcatki@jcatki.no-ip.org>
Subject: SDL patch: DGA key events

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
src/video/dga/SDL_dgaevents.c
     1.1 --- a/src/video/dga/SDL_dgaevents.c	Thu Dec 01 19:22:32 2005 +0000
     1.2 +++ b/src/video/dga/SDL_dgaevents.c	Mon Dec 05 04:36:53 2005 +0000
     1.3 @@ -36,10 +36,13 @@
     1.4  #include "SDL_dgavideo.h"
     1.5  #include "SDL_dgaevents_c.h"
     1.6  
     1.7 +/* get function pointers... */
     1.8 +#include "../x11/SDL_x11dyn.h"
     1.9 +
    1.10  /* Heheh we're using X11 event code */
    1.11  extern int X11_Pending(Display *display);
    1.12  extern void X11_InitKeymap(void);
    1.13 -extern SDL_keysym *X11_TranslateKey(Display *display, XKeyEvent *xkey,
    1.14 +extern SDL_keysym *X11_TranslateKey(Display *display, XIC ic, XKeyEvent *xkey,
    1.15  				    KeyCode kc, SDL_keysym *keysym);
    1.16  
    1.17  static int DGA_DispatchEvent(_THIS)
    1.18 @@ -84,7 +87,7 @@
    1.19  
    1.20  		SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey);
    1.21  		posted = SDL_PrivateKeyboard((xevent.type == KeyPress), 
    1.22 -					X11_TranslateKey(DGA_Display,
    1.23 +					X11_TranslateKey(DGA_Display, NULL/*no XIC*/,
    1.24  							 &xkey, xkey.keycode,
    1.25  							 &keysym));
    1.26  	    }