From cf9828a2a686bf28d531c8678873433054ac176a Mon Sep 17 00:00:00 2001 From: Gabriel Jacobo Date: Mon, 20 Jan 2014 20:25:43 -0300 Subject: [PATCH] Move Wayland driver above dummy, check for driver availability before creation --- src/video/SDL_video.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 26e234459..157cfa9e7 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -83,11 +83,11 @@ static VideoBootStrap *bootstrap[] = { #if SDL_VIDEO_DRIVER_RPI &RPI_bootstrap, #endif -#if SDL_VIDEO_DRIVER_DUMMY - &DUMMY_bootstrap, -#endif #if SDL_VIDEO_DRIVER_WAYLAND &Wayland_bootstrap, +#endif +#if SDL_VIDEO_DRIVER_DUMMY + &DUMMY_bootstrap, #endif NULL }; @@ -447,8 +447,10 @@ SDL_VideoInit(const char *driver_name) if (driver_name != NULL) { for (i = 0; bootstrap[i]; ++i) { if (SDL_strncasecmp(bootstrap[i]->name, driver_name, SDL_strlen(driver_name)) == 0) { - video = bootstrap[i]->create(index); - break; + if (bootstrap[i]->available()) { + video = bootstrap[i]->create(index); + break; + } } } } else {