Move Wayland driver above dummy, check for driver availability before creation
authorGabriel Jacobo <gabomdq@gmail.com>
Mon, 20 Jan 2014 20:25:43 -0300
changeset 8117988502081380
parent 8116 f7c2f71251e5
child 8118 f0b6338dc866
Move Wayland driver above dummy, check for driver availability before creation
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Mon Jan 20 12:53:44 2014 -0500
     1.2 +++ b/src/video/SDL_video.c	Mon Jan 20 20:25:43 2014 -0300
     1.3 @@ -83,12 +83,12 @@
     1.4  #if SDL_VIDEO_DRIVER_RPI
     1.5      &RPI_bootstrap,
     1.6  #endif 
     1.7 +#if SDL_VIDEO_DRIVER_WAYLAND
     1.8 +    &Wayland_bootstrap,
     1.9 +#endif
    1.10  #if SDL_VIDEO_DRIVER_DUMMY
    1.11      &DUMMY_bootstrap,
    1.12  #endif
    1.13 -#if SDL_VIDEO_DRIVER_WAYLAND
    1.14 -    &Wayland_bootstrap,
    1.15 -#endif
    1.16      NULL
    1.17  };
    1.18  
    1.19 @@ -447,8 +447,10 @@
    1.20      if (driver_name != NULL) {
    1.21          for (i = 0; bootstrap[i]; ++i) {
    1.22              if (SDL_strncasecmp(bootstrap[i]->name, driver_name, SDL_strlen(driver_name)) == 0) {
    1.23 -                video = bootstrap[i]->create(index);
    1.24 -                break;
    1.25 +                if (bootstrap[i]->available()) {
    1.26 +                    video = bootstrap[i]->create(index);
    1.27 +                    break;
    1.28 +                }
    1.29              }
    1.30          }
    1.31      } else {