Couriersud to Sam
authorSam Lantinga
Fri, 23 Jul 2010 21:33:00 -0700
changeset 456825b9cd8bdc30
parent 4567 1d7ea8724f4a
child 4569 e1664f94f026
Couriersud to Sam

I have done some quick changes and at least the code compiles again. It
also works with a number of the test executables with the DFB X11
backend. I hope to find time to get SDLMAME to work with latest SDL1.3
(i.e. rip out multi-keyboard, multi-mice & cursor support) next week to
test it further.

Regards,

André
src/video/directfb/SDL_DirectFB_WM.c
src/video/directfb/SDL_DirectFB_events.c
src/video/directfb/SDL_DirectFB_modes.h
src/video/directfb/SDL_DirectFB_mouse.c
src/video/directfb/SDL_DirectFB_render.c
src/video/directfb/SDL_DirectFB_video.c
src/video/directfb/SDL_DirectFB_video.h
src/video/directfb/SDL_DirectFB_window.c
src/video/directfb/SDL_DirectFB_window.h
     1.1 --- a/src/video/directfb/SDL_DirectFB_WM.c	Thu Jul 22 22:09:04 2010 -0700
     1.2 +++ b/src/video/directfb/SDL_DirectFB_WM.c	Fri Jul 23 21:33:00 2010 -0700
     1.3 @@ -210,7 +210,7 @@
     1.4      windata->window->MoveTo(windata->window, 0, 0);
     1.5      windata->window->Resize(windata->window,
     1.6                              display->current_mode.w, display->current_mode.h);
     1.7 -    SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
     1.8 +    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
     1.9  }
    1.10  
    1.11  void
    1.12 @@ -226,7 +226,7 @@
    1.13                              windata->restore.y);
    1.14      windata->window->Resize(windata->window, windata->restore.w,
    1.15                              windata->restore.h);
    1.16 -    SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_RESTORED, 0, 0);
    1.17 +    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
    1.18  }
    1.19  
    1.20  enum
    1.21 @@ -304,7 +304,7 @@
    1.22              case WM_POS_NONE:
    1.23                  return 0;
    1.24              case WM_POS_CLOSE:
    1.25 -                SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0,
    1.26 +                SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0,
    1.27                                      0);
    1.28                  return 1;
    1.29              case WM_POS_MAX:
     2.1 --- a/src/video/directfb/SDL_DirectFB_events.c	Thu Jul 22 22:09:04 2010 -0700
     2.2 +++ b/src/video/directfb/SDL_DirectFB_events.c	Fri Jul 23 21:33:00 2010 -0700
     2.3 @@ -32,6 +32,19 @@
     2.4  #include "../../events/scancodes_linux.h"
     2.5  #include "SDL_DirectFB_events.h"
     2.6  
     2.7 +#if USE_MULTI_API
     2.8 +#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(id, relative, x, y, p)
     2.9 +#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(id, state, button)
    2.10 +#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(id, state, scancode)
    2.11 +#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(id, text)
    2.12 +#else
    2.13 +#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(relative, x, y)
    2.14 +#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(state, button)
    2.15 +#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(state, scancode)
    2.16 +#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(text)
    2.17 +#endif
    2.18 +
    2.19 +
    2.20  /* The translation tables from a DirectFB keycode to a SDL keysym */
    2.21  static SDLKey oskeymap[256];
    2.22  static int sys_ids;
    2.23 @@ -54,7 +67,6 @@
    2.24       *        This has simply no effect.
    2.25       */
    2.26  
    2.27 -    SDL_Window *window = SDL_GetWindowFromID(id);
    2.28      SDL_VideoDisplay *display = window->display;
    2.29      DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
    2.30      int ret;
    2.31 @@ -72,27 +84,36 @@
    2.32  static void
    2.33  FocusAllMice(_THIS, SDL_Window *window)
    2.34  {
    2.35 +#if USE_MULTI_API
    2.36      SDL_DFB_DEVICEDATA(_this);
    2.37      int index;
    2.38  
    2.39      for (index = 0; index < devdata->num_mice; index++)
    2.40          SDL_SetMouseFocus(devdata->mouse_id[index], id);
    2.41 +#else
    2.42 +    SDL_SetMouseFocus(window);
    2.43 +#endif
    2.44  }
    2.45  
    2.46  
    2.47  static void
    2.48  FocusAllKeyboards(_THIS, SDL_Window *window)
    2.49  {
    2.50 +#if USE_MULTI_API
    2.51      SDL_DFB_DEVICEDATA(_this);
    2.52      int index;
    2.53  
    2.54      for (index = 0; index < devdata->num_keyboard; index++)
    2.55          SDL_SetKeyboardFocus(index, id);
    2.56 +#else
    2.57 +    SDL_SetKeyboardFocus(window);
    2.58 +#endif
    2.59  }
    2.60  
    2.61  static void
    2.62  MotionAllMice(_THIS, int x, int y)
    2.63  {
    2.64 +#if USE_MULTI_API
    2.65      SDL_DFB_DEVICEDATA(_this);
    2.66      int index;
    2.67  
    2.68 @@ -102,6 +123,7 @@
    2.69          mouse->y = mouse->last_y = y;
    2.70          //SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0);
    2.71      }
    2.72 +#endif
    2.73  }
    2.74  
    2.75  static int
    2.76 @@ -150,9 +172,9 @@
    2.77          case DWET_BUTTONDOWN:
    2.78              if (ClientXY(p, &evt->x, &evt->y)) {
    2.79                  if (!devdata->use_linux_input) {
    2.80 -                    SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt->x,
    2.81 +                    SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x,
    2.82                                          evt->y, 0);
    2.83 -                    SDL_SendMouseButton(devdata->mouse_id[0],
    2.84 +                    SDL_SendMouseButton_ex(devdata->mouse_id[0],
    2.85                                          SDL_PRESSED,
    2.86                                          DirectFB_TranslateButton
    2.87                                          (evt->button));
    2.88 @@ -164,9 +186,9 @@
    2.89          case DWET_BUTTONUP:
    2.90              if (ClientXY(p, &evt->x, &evt->y)) {
    2.91                  if (!devdata->use_linux_input) {
    2.92 -                    SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt->x,
    2.93 +                    SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x,
    2.94                                          evt->y, 0);
    2.95 -                    SDL_SendMouseButton(devdata->mouse_id[0],
    2.96 +                    SDL_SendMouseButton_ex(devdata->mouse_id[0],
    2.97                                          SDL_RELEASED,
    2.98                                          DirectFB_TranslateButton
    2.99                                          (evt->button));
   2.100 @@ -177,10 +199,10 @@
   2.101              break;
   2.102          case DWET_MOTION:
   2.103              if (ClientXY(p, &evt->x, &evt->y)) {
   2.104 -                SDL_Window *window = p->window;
   2.105 +                SDL_Window *window = p->sdl_window;
   2.106                  if (!devdata->use_linux_input) {
   2.107                      if (!(flags & SDL_WINDOW_INPUT_GRABBED))
   2.108 -                        SDL_SendMouseMotion(devdata->mouse_id[0], 0,
   2.109 +                        SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0,
   2.110                                              evt->x, evt->y, 0);
   2.111                  } else {
   2.112                      /* relative movements are not exact! 
   2.113 @@ -200,12 +222,12 @@
   2.114          case DWET_KEYDOWN:
   2.115              if (!devdata->use_linux_input) {
   2.116                  DirectFB_TranslateKey(_this, evt, &keysym);
   2.117 -                SDL_SendKeyboardKey(0, SDL_PRESSED, keysym.scancode);
   2.118 +                SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode);
   2.119                  if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
   2.120                      SDL_memcpy(text, &keysym.unicode, 4);
   2.121                      text[4] = 0;
   2.122                      if (*text) {
   2.123 -                        SDL_SendKeyboardText(0, text);
   2.124 +                        SDL_SendKeyboardText_ex(0, text);
   2.125                      }
   2.126                  }
   2.127              }
   2.128 @@ -213,18 +235,18 @@
   2.129          case DWET_KEYUP:
   2.130              if (!devdata->use_linux_input) {
   2.131                  DirectFB_TranslateKey(_this, evt, &keysym);
   2.132 -                SDL_SendKeyboardKey(0, SDL_RELEASED, keysym.scancode);
   2.133 +                SDL_SendKeyboardKey_ex(0, SDL_RELEASED, keysym.scancode);
   2.134              }
   2.135              break;
   2.136          case DWET_POSITION:
   2.137              if (ClientXY(p, &evt->x, &evt->y)) {
   2.138 -                SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_MOVED,
   2.139 +                SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED,
   2.140                                      evt->x, evt->y);
   2.141              }
   2.142              break;
   2.143          case DWET_POSITION_SIZE:
   2.144              if (ClientXY(p, &evt->x, &evt->y)) {
   2.145 -                SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_MOVED,
   2.146 +                SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED,
   2.147                                      evt->x, evt->y);
   2.148              }
   2.149              /* fall throught */
   2.150 @@ -234,32 +256,32 @@
   2.151              evt->h -=
   2.152                  (p->theme.top_size + p->theme.bottom_size +
   2.153                   p->theme.caption_size);
   2.154 -            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_RESIZED,
   2.155 +            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_RESIZED,
   2.156                                  evt->w, evt->h);
   2.157              break;
   2.158          case DWET_CLOSE:
   2.159 -            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
   2.160 +            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_CLOSE, 0, 0);
   2.161              break;
   2.162          case DWET_GOTFOCUS:
   2.163 -            DirectFB_SetContext(_this, p->window);
   2.164 -            FocusAllKeyboards(_this, p->window);
   2.165 -            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_FOCUS_GAINED,
   2.166 +            DirectFB_SetContext(_this, p->sdl_window);
   2.167 +            FocusAllKeyboards(_this, p->sdl_window);
   2.168 +            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_GAINED,
   2.169                                  0, 0);
   2.170              break;
   2.171          case DWET_LOSTFOCUS:
   2.172 -            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
   2.173 +            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
   2.174              FocusAllKeyboards(_this, 0);
   2.175              break;
   2.176          case DWET_ENTER:
   2.177              /* SDL_DirectFB_ReshowCursor(_this, 0); */
   2.178 -            FocusAllMice(_this, p->window);
   2.179 +            FocusAllMice(_this, p->sdl_window);
   2.180              // FIXME: when do we really enter ?
   2.181              if (ClientXY(p, &evt->x, &evt->y))
   2.182                  MotionAllMice(_this, evt->x, evt->y);
   2.183 -            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_ENTER, 0, 0);
   2.184 +            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_ENTER, 0, 0);
   2.185              break;
   2.186          case DWET_LEAVE:
   2.187 -            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_LEAVE, 0, 0);
   2.188 +            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_LEAVE, 0, 0);
   2.189              FocusAllMice(_this, 0);
   2.190              /* SDL_DirectFB_ReshowCursor(_this, 1); */
   2.191              break;
   2.192 @@ -271,7 +293,7 @@
   2.193  }
   2.194  
   2.195  static void
   2.196 -ProcessInputEvent(_THIS, Sint32 grabbed_window, DFBInputEvent * ievt)
   2.197 +ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt)
   2.198  {
   2.199      SDL_DFB_DEVICEDATA(_this);
   2.200      SDL_keysym keysym;
   2.201 @@ -280,16 +302,17 @@
   2.202  
   2.203      if (!devdata->use_linux_input) {
   2.204          if (ievt->type == DIET_AXISMOTION) {
   2.205 -            if ((grabbed_window >= 0) && (ievt->flags & DIEF_AXISREL)) {
   2.206 +            if ((grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) {
   2.207                  if (ievt->axis == DIAI_X)
   2.208 -                    SDL_SendMouseMotion(ievt->device_id, 1,
   2.209 +                    SDL_SendMouseMotion_ex(ievt->device_id, 1,
   2.210                                          ievt->axisrel, 0, 0);
   2.211                  else if (ievt->axis == DIAI_Y)
   2.212 -                    SDL_SendMouseMotion(ievt->device_id, 1, 0,
   2.213 +                    SDL_SendMouseMotion_ex(ievt->device_id, 1, 0,
   2.214                                          ievt->axisrel, 0);
   2.215              }
   2.216          }
   2.217      } else {
   2.218 +#if USE_MULTI_API
   2.219          static int last_x, last_y;
   2.220  
   2.221          switch (ievt->type) {
   2.222 @@ -308,34 +331,34 @@
   2.223                          int x, y;
   2.224  
   2.225                          windata->window->GetPosition(windata->window, &x, &y);
   2.226 -                        SDL_SendMouseMotion(ievt->device_id, 0,
   2.227 +                        SDL_SendMouseMotion_ex(ievt->device_id, 0,
   2.228                                              last_x - (x +
   2.229                                                        windata->client.x),
   2.230                                              last_y - (y +
   2.231                                                        windata->client.y), 0);
   2.232                      } else {
   2.233 -                        SDL_SendMouseMotion(ievt->device_id, 0, last_x,
   2.234 +                        SDL_SendMouseMotion_ex(ievt->device_id, 0, last_x,
   2.235                                              last_y, 0);
   2.236                      }
   2.237                  }
   2.238              } else if (ievt->flags & DIEF_AXISREL) {
   2.239                  if (ievt->axis == DIAI_X)
   2.240 -                    SDL_SendMouseMotion(ievt->device_id, 1,
   2.241 +                    SDL_SendMouseMotion_ex(ievt->device_id, 1,
   2.242                                          ievt->axisrel, 0, 0);
   2.243                  else if (ievt->axis == DIAI_Y)
   2.244 -                    SDL_SendMouseMotion(ievt->device_id, 1, 0,
   2.245 +                    SDL_SendMouseMotion_ex(ievt->device_id, 1, 0,
   2.246                                          ievt->axisrel, 0);
   2.247              }
   2.248              break;
   2.249          case DIET_KEYPRESS:
   2.250              kbd_idx = KbdIndex(_this, ievt->device_id);
   2.251              DirectFB_TranslateKeyInputEvent(_this, kbd_idx, ievt, &keysym);
   2.252 -            SDL_SendKeyboardKey(kbd_idx, SDL_PRESSED, keysym.scancode);
   2.253 +            SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode);
   2.254              if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
   2.255                  SDL_memcpy(text, &keysym.unicode, 4);
   2.256                  text[4] = 0;
   2.257                  if (*text) {
   2.258 -                    SDL_SendKeyboardText(kbd_idx, text);
   2.259 +                    SDL_SendKeyboardText_ex(kbd_idx, text);
   2.260                  }
   2.261              }
   2.262              break;
   2.263 @@ -363,6 +386,7 @@
   2.264          default:
   2.265              break;              /* please gcc */
   2.266          }
   2.267 +#endif
   2.268      }
   2.269  }
   2.270  
   2.271 @@ -378,7 +402,7 @@
   2.272  
   2.273      for (p = devdata->firstwin; p != NULL; p = p->next) {
   2.274          DFBWindowEvent evt;
   2.275 -        SDL_Window *w = SDL_GetWindowFromID(p->window);
   2.276 +        SDL_Window *w = p->sdl_window;
   2.277  
   2.278          if (w->flags & SDL_WINDOW_INPUT_GRABBED) {
   2.279              grabbed_window = w;
   2.280 @@ -603,19 +627,27 @@
   2.281                  DFBInputDeviceDescription desc, void *callbackdata)
   2.282  {
   2.283      DFB_DeviceData *devdata = callbackdata;
   2.284 +#if USE_MULTI_API
   2.285      SDL_Keyboard keyboard;
   2.286 +#endif
   2.287      SDLKey keymap[SDL_NUM_SCANCODES];
   2.288  
   2.289      if ((desc.caps & DIDTF_KEYBOARD) && device_id == DIDID_KEYBOARD) {
   2.290 +#if USE_MULTI_API
   2.291          SDL_zero(keyboard);
   2.292          SDL_AddKeyboard(&keyboard, 0);
   2.293 +#endif
   2.294          devdata->keyboard[0].id = device_id;
   2.295          devdata->keyboard[0].is_generic = 0;
   2.296          if (!strncmp("X11", desc.name, 3))
   2.297              devdata->keyboard[0].is_generic = 1;
   2.298  
   2.299          SDL_GetDefaultKeymap(keymap);
   2.300 +#if USE_MULTI_API
   2.301          SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
   2.302 +#else
   2.303 +        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
   2.304 +#endif
   2.305          devdata->num_keyboard++;
   2.306  
   2.307          return DFENUM_CANCEL;
   2.308 @@ -623,6 +655,7 @@
   2.309      return DFENUM_OK;
   2.310  }
   2.311  
   2.312 +#if USE_MULTI_API
   2.313  static DFBEnumerationResult
   2.314  EnumKeyboards(DFBInputDeviceID device_id,
   2.315                DFBInputDeviceDescription desc, void *callbackdata)
   2.316 @@ -652,6 +685,7 @@
   2.317      }
   2.318      return DFENUM_OK;
   2.319  }
   2.320 +#endif
   2.321  
   2.322  void
   2.323  DirectFB_InitKeyboard(_THIS)
   2.324 @@ -662,6 +696,7 @@
   2.325      DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap));
   2.326  
   2.327      devdata->num_keyboard = 0;
   2.328 +#if USE_MULTI_API
   2.329      if (devdata->use_linux_input) {
   2.330          sys_ids = 0;
   2.331          SDL_DFB_CHECK(devdata->dfb->
   2.332 @@ -672,11 +707,14 @@
   2.333                                                           EnumKeyboards,
   2.334                                                           devdata));
   2.335          }
   2.336 -    } else {
   2.337 +    } else
   2.338 +#else
   2.339 +    {
   2.340          SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
   2.341                                                       input_device_cb,
   2.342                                                       devdata));
   2.343      }
   2.344 +#endif
   2.345  }
   2.346  
   2.347  void
   2.348 @@ -759,3 +797,4 @@
   2.349      }
   2.350  }
   2.351  #endif
   2.352 +
     3.1 --- a/src/video/directfb/SDL_DirectFB_modes.h	Thu Jul 22 22:09:04 2010 -0700
     3.2 +++ b/src/video/directfb/SDL_DirectFB_modes.h	Fri Jul 23 21:33:00 2010 -0700
     3.3 @@ -26,7 +26,7 @@
     3.4  
     3.5  #include "SDL_DirectFB_video.h"
     3.6  
     3.7 -#define SDL_DFB_DISPLAYDATA(dev, win)  DFB_DisplayData *dispdata = ((win && dev) ? (DFB_DisplayData *) (dev)->displays[(win)->display].driverdata : NULL)
     3.8 +#define SDL_DFB_DISPLAYDATA(dev, win)  DFB_DisplayData *dispdata = ((win && dev) ? (DFB_DisplayData *) (win)->display->driverdata : NULL)
     3.9  
    3.10  typedef struct _DFB_DisplayData DFB_DisplayData;
    3.11  struct _DFB_DisplayData
     4.1 --- a/src/video/directfb/SDL_DirectFB_mouse.c	Thu Jul 22 22:09:04 2010 -0700
     4.2 +++ b/src/video/directfb/SDL_DirectFB_mouse.c	Fri Jul 23 21:33:00 2010 -0700
     4.3 @@ -26,6 +26,7 @@
     4.4  #include "../SDL_sysvideo.h"
     4.5  #include "../../events/SDL_mouse_c.h"
     4.6  
     4.7 +#if USE_MULTI_API
     4.8  static SDL_Cursor *DirectFB_CreateCursor(SDL_Surface * surface,
     4.9                                           int hot_x, int hot_y);
    4.10  static int DirectFB_ShowCursor(SDL_Cursor * cursor);
    4.11 @@ -239,4 +240,23 @@
    4.12      /* nothing yet */
    4.13  }
    4.14  
    4.15 +#else /* USE_MULTI_API */
    4.16 +
    4.17 +void
    4.18 +DirectFB_InitMouse(_THIS)
    4.19 +{
    4.20 +    SDL_DFB_DEVICEDATA(_this);
    4.21 +
    4.22 +    devdata->num_mice = 1;
    4.23 +}
    4.24 +
    4.25 +void
    4.26 +DirectFB_QuitMouse(_THIS)
    4.27 +{
    4.28 +    SDL_DFB_DEVICEDATA(_this);
    4.29 +}
    4.30 +
    4.31 +
    4.32 +#endif
    4.33 +
    4.34  /* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Thu Jul 22 22:09:04 2010 -0700
     5.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Fri Jul 23 21:33:00 2010 -0700
     5.3 @@ -423,7 +423,7 @@
     5.4  DirectFB_ActivateRenderer(SDL_Renderer * renderer)
     5.5  {
     5.6      SDL_DFB_RENDERERDATA(renderer);
     5.7 -    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
     5.8 +    SDL_Window *window = renderer->window;
     5.9      SDL_DFB_WINDOWDATA(window);
    5.10  
    5.11      if (renddata->size_changed || windata->wm_needs_redraw) {
    5.12 @@ -445,7 +445,7 @@
    5.13  DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture)
    5.14  {
    5.15      SDL_DFB_RENDERERDATA(renderer);
    5.16 -    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
    5.17 +    SDL_Window *window = renderer->window;
    5.18      SDL_VideoDisplay *display = window->display;
    5.19      SDL_DFB_DEVICEDATA(display->device);
    5.20      DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
    5.21 @@ -501,7 +501,7 @@
    5.22  static int
    5.23  DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
    5.24  {
    5.25 -    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
    5.26 +    SDL_Window *window = renderer->window;
    5.27      SDL_VideoDisplay *display = window->display;
    5.28      SDL_DFB_DEVICEDATA(display->device);
    5.29      DirectFB_TextureData *data;
    5.30 @@ -950,7 +950,7 @@
    5.31  
    5.32      if (texturedata->display) {
    5.33          int px, py;
    5.34 -        SDL_Window *window = SDL_GetWindowFromID(renderer->window);
    5.35 +        SDL_Window *window = renderer->window;
    5.36          SDL_DFB_WINDOWDATA(window);
    5.37          SDL_VideoDisplay *display = texturedata->display;
    5.38          DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
    5.39 @@ -1048,7 +1048,7 @@
    5.40  DirectFB_RenderPresent(SDL_Renderer * renderer)
    5.41  {
    5.42      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
    5.43 -    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
    5.44 +    SDL_Window *window = renderer->window;
    5.45      SDL_DFB_WINDOWDATA(window);
    5.46  
    5.47      DFBRectangle sr;
     6.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Thu Jul 22 22:09:04 2010 -0700
     6.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Fri Jul 23 21:33:00 2010 -0700
     6.3 @@ -129,7 +129,7 @@
     6.4  #endif
     6.5  
     6.6      device->free = DirectFB_DeleteDevice;
     6.7 -
     6.8 +	fprintf(LOG_CHANNEL, "Device setup %p!!\n", device->ShowWindow);
     6.9      return device;
    6.10    error:
    6.11      if (device)
    6.12 @@ -163,19 +163,20 @@
    6.13      fprintf(LOG_CHANNEL, "\nBlitting flags:\n");
    6.14      for (n = 0; blitting_flags[n].flag; n++) {
    6.15          if (desc.blitting_flags & blitting_flags[n].flag)
    6.16 -            printf("    %s\n", blitting_flags[n].name);
    6.17 +            fprintf(LOG_CHANNEL, "    %s\n", blitting_flags[n].name);
    6.18      }
    6.19  
    6.20      fprintf(LOG_CHANNEL, "\nDrawing flags:\n");
    6.21      for (n = 0; drawing_flags[n].flag; n++) {
    6.22          if (desc.drawing_flags & drawing_flags[n].flag)
    6.23 -            printf("    %s\n", drawing_flags[n].name);
    6.24 +            fprintf(LOG_CHANNEL, "    %s\n", drawing_flags[n].name);
    6.25      }
    6.26  
    6.27 +
    6.28      fprintf(LOG_CHANNEL, "\nAcceleration flags:\n");
    6.29      for (n = 0; acceleration_mask[n].mask; n++) {
    6.30          if (desc.acceleration_mask & acceleration_mask[n].mask)
    6.31 -            printf("    %s\n", acceleration_mask[n].name);
    6.32 +            fprintf(LOG_CHANNEL, "    %s\n", acceleration_mask[n].name);
    6.33      }
    6.34  
    6.35  
    6.36 @@ -208,10 +209,14 @@
    6.37              DirectFBSetOption("disable-module", "x11input");
    6.38      }
    6.39  
    6.40 -    devdata->use_linux_input = 1;       /* default: on */
    6.41 +#if USE_MULTI_API
    6.42 +	devdata->use_linux_input = 1;       /* default: on */
    6.43      stemp = SDL_getenv(DFBENV_USE_LINUX_INPUT);
    6.44      if (stemp)
    6.45          devdata->use_linux_input = atoi(stemp);
    6.46 +#else
    6.47 +	devdata->use_linux_input = 0;       /* no way to support this ... */
    6.48 +#endif
    6.49  
    6.50      if (!devdata->use_linux_input)
    6.51          DirectFBSetOption("disable-module", "linux_input");
     7.1 --- a/src/video/directfb/SDL_DirectFB_video.h	Thu Jul 22 22:09:04 2010 -0700
     7.2 +++ b/src/video/directfb/SDL_DirectFB_video.h	Fri Jul 23 21:33:00 2010 -0700
     7.3 @@ -31,7 +31,14 @@
     7.4  
     7.5  #include "SDL_mouse.h"
     7.6  
     7.7 -#define DEBUG 0
     7.8 +
     7.9 +/* Set below to 1 to compile with (old) multi mice/keyboard api. Code left in
    7.10 + * in case we see this again ... 
    7.11 + */
    7.12 +
    7.13 +#define USE_MULTI_API	(0)
    7.14 +
    7.15 +#define DEBUG 1
    7.16  #define LOG_CHANNEL 	stdout
    7.17  
    7.18  #define DFB_VERSIONNUM(X, Y, Z)						\
     8.1 --- a/src/video/directfb/SDL_DirectFB_window.c	Thu Jul 22 22:09:04 2010 -0700
     8.2 +++ b/src/video/directfb/SDL_DirectFB_window.c	Fri Jul 23 21:33:00 2010 -0700
     8.3 @@ -140,7 +140,7 @@
     8.4      windata->window->RaiseToTop(windata->window);
     8.5  
     8.6      /* remember parent */
     8.7 -    windata->window = window;
     8.8 +    windata->sdl_window = window;
     8.9  
    8.10      /* Add to list ... */
    8.11  
     9.1 --- a/src/video/directfb/SDL_DirectFB_window.h	Thu Jul 22 22:09:04 2010 -0700
     9.2 +++ b/src/video/directfb/SDL_DirectFB_window.h	Fri Jul 23 21:33:00 2010 -0700
     9.3 @@ -36,7 +36,7 @@
     9.4      IDirectFBWindow *window;
     9.5      DirectFB_GLContext *gl_context;
     9.6      IDirectFBEventBuffer *eventbuffer;
     9.7 -    SDL_Window *window;
     9.8 +    SDL_Window *sdl_window;
     9.9      DFB_WindowData *next;
    9.10      Uint8 opacity;
    9.11      DFBRectangle client;