diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index 6045b1e6be..800da4c54c 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -443,12 +443,19 @@ static void *sdl2_gfx_init(const video_info_t *video, #elif defined(HAVE_COCOA) sdl2_set_handles(vid->window, RARCH_DISPLAY_OSX); #else +#if defined(HAVE_X11) || defined(HAVE_WAYLAND) const char *video_driver = SDL_GetCurrentVideoDriver(); +#endif +#ifdef HAVE_X11 if (strcmp(video_driver, "x11") == 0) sdl2_set_handles(vid->window, RARCH_DISPLAY_X11); - else if (strcmp(video_driver, "wayland") == 0) + else +#endif +#ifdef HAVE_WAYLAND + if (strcmp(video_driver, "wayland") == 0) sdl2_set_handles(vid->window, RARCH_DISPLAY_WAYLAND); else +#endif sdl2_set_handles(vid->window, RARCH_DISPLAY_NONE); #endif