diff --git a/gfx/sdl2_gfx.c b/gfx/sdl2_gfx.c index 71d1100c45..c60a060d4c 100644 --- a/gfx/sdl2_gfx.c +++ b/gfx/sdl2_gfx.c @@ -198,25 +198,21 @@ static void sdl2_render_msg(sdl2_video_t *vid, const char *msg) static void sdl2_gfx_set_handles(sdl2_video_t *vid) { // SysWMinfo headers are broken on OSX. :( -#if defined(_WIN32) +#if defined(_WIN32) || defined(HAVE_X11) SDL_SysWMinfo info; SDL_VERSION(&info.version); if (SDL_GetWindowWMInfo(vid->window, &info) == 1) { +#if defined(_WIN32) driver.display_type = RARCH_DISPLAY_WIN32; driver.video_display = 0; driver.video_window = (uintptr_t)info.info.win.window; - } #elif defined(HAVE_X11) - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - - if (SDL_GetWindowWMInfo(vid->window, &info) == 1) - { driver.display_type = RARCH_DISPLAY_X11; driver.video_display = (uintptr_t)info.info.x11.display; driver.video_window = (uintptr_t)info.info.x11.window; +#endif } #endif } diff --git a/gfx/sdl_gfx.c b/gfx/sdl_gfx.c index 80dedca1ac..ec8214f31c 100644 --- a/gfx/sdl_gfx.c +++ b/gfx/sdl_gfx.c @@ -31,7 +31,7 @@ #include "config.h" #endif -#include "SDL/SDL_syswm.h" +#include "SDL_syswm.h" typedef struct sdl_menu_frame { @@ -210,25 +210,21 @@ static void sdl_render_msg(sdl_video_t *vid, SDL_Surface *buffer, static void sdl_gfx_set_handles(void) { // SysWMinfo headers are broken on OSX. :( -#if defined(_WIN32) +#if defined(_WIN32) || defined(HAVE_X11) SDL_SysWMinfo info; SDL_VERSION(&info.version); if (SDL_GetWMInfo(&info) == 1) { +#if defined(_WIN32) driver.display_type = RARCH_DISPLAY_WIN32; driver.video_display = 0; driver.video_window = (uintptr_t)info.window; - } #elif defined(HAVE_X11) - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - - if (SDL_GetWMInfo(&info) == 1) - { driver.display_type = RARCH_DISPLAY_X11; driver.video_display = (uintptr_t)info.info.x11.display; driver.video_window = (uintptr_t)info.info.x11.window; +#endif } #endif }