Implemented X11 system window manager info for SDL 1.3. It's simple. Really.
authorSam Lantinga <slouken@libsdl.org>
Mon, 12 Jul 2010 01:20:57 -0700
changeset 45106f8175ad0335
parent 4509 8e91c3947210
child 4511 ae7799d16c87
child 4661 03dcb795c583
Implemented X11 system window manager info for SDL 1.3. It's simple. Really.
include/SDL_syswm.h
src/video/x11/SDL_x11window.c
     1.1 --- a/include/SDL_syswm.h	Mon Jul 12 00:49:26 2010 -0700
     1.2 +++ b/include/SDL_syswm.h	Mon Jul 12 01:20:57 2010 -0700
     1.3 @@ -106,24 +106,6 @@
     1.4          {
     1.5              Display *display;   /**< The X11 display */
     1.6              Window window;      /**< The X11 display window */
     1.7 -            /**
     1.8 -             *  These locking functions should be called around
     1.9 -             *  any X11 functions using the display variable.
    1.10 -             *  They lock the event thread, so should not be
    1.11 -             *  called around event functions or from event filters.
    1.12 -             */
    1.13 -            /*@{*/
    1.14 -            void (*lock_func) (void);
    1.15 -            void (*unlock_func) (void);
    1.16 -            /*@}*/
    1.17 -
    1.18 -            /**
    1.19 -             *  Introduced in SDL 1.0.2.
    1.20 -             */
    1.21 -            /*@{*/
    1.22 -            Window fswindow;    /**< The X11 fullscreen window */
    1.23 -            Window wmwindow;    /**< The X11 managed input window */
    1.24 -            /*@}*/
    1.25          } x11;
    1.26      } info;
    1.27  };
     2.1 --- a/src/video/x11/SDL_x11window.c	Mon Jul 12 00:49:26 2010 -0700
     2.2 +++ b/src/video/x11/SDL_x11window.c	Mon Jul 12 01:20:57 2010 -0700
     2.3 @@ -1014,8 +1014,14 @@
     2.4  SDL_bool
     2.5  X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
     2.6  {
     2.7 -    if (info->version.major <= SDL_MAJOR_VERSION) {
     2.8 -        /* FIXME! */
     2.9 +    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    2.10 +    Display *display = data->videodata->display;
    2.11 +
    2.12 +    if (info->version.major == SDL_MAJOR_VERSION &&
    2.13 +        info->version.minor == SDL_MINOR_VERSION) {
    2.14 +        info->subsystem = SDL_SYSWM_X11;
    2.15 +        info->info.x11.display = display;
    2.16 +        info->info.x11.window = data->xwindow;
    2.17          return SDL_TRUE;
    2.18      } else {
    2.19          SDL_SetError("Application not compiled with SDL %d.%d\n",