From 111d7b44914dcbe9b1b134a3ca523f81a992f9c7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 12 Jul 2010 01:20:57 -0700 Subject: [PATCH] Implemented X11 system window manager info for SDL 1.3. It's simple. Really. --- include/SDL_syswm.h | 18 ------------------ src/video/x11/SDL_x11window.c | 10 ++++++++-- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 56ef7f6d2..4f7d00720 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -106,24 +106,6 @@ struct SDL_SysWMinfo { Display *display; /**< The X11 display */ Window window; /**< The X11 display window */ - /** - * These locking functions should be called around - * any X11 functions using the display variable. - * They lock the event thread, so should not be - * called around event functions or from event filters. - */ - /*@{*/ - void (*lock_func) (void); - void (*unlock_func) (void); - /*@}*/ - - /** - * Introduced in SDL 1.0.2. - */ - /*@{*/ - Window fswindow; /**< The X11 fullscreen window */ - Window wmwindow; /**< The X11 managed input window */ - /*@}*/ } x11; } info; }; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 9fd1350e6..78d94dab2 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1014,8 +1014,14 @@ X11_DestroyWindow(_THIS, SDL_Window * window) SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { - if (info->version.major <= SDL_MAJOR_VERSION) { - /* FIXME! */ + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + Display *display = data->videodata->display; + + if (info->version.major == SDL_MAJOR_VERSION && + info->version.minor == SDL_MINOR_VERSION) { + info->subsystem = SDL_SYSWM_X11; + info->info.x11.display = display; + info->info.x11.window = data->xwindow; return SDL_TRUE; } else { SDL_SetError("Application not compiled with SDL %d.%d\n",