src/video/x11/SDL_x11modes.c
branchSDL-1.2
changeset 4254 8afecb86be35
parent 4223 63fd67e17705
child 4274 915406c331dc
     1.1 --- a/src/video/x11/SDL_x11modes.c	Sun Sep 27 22:29:13 2009 +0000
     1.2 +++ b/src/video/x11/SDL_x11modes.c	Sun Sep 27 22:41:34 2009 +0000
     1.3 @@ -338,6 +338,18 @@
     1.4      XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y);
     1.5  }
     1.6  
     1.7 +static int add_default_visual(_THIS)
     1.8 +{
     1.9 +    int i;
    1.10 +    int n = this->hidden->nvisuals;
    1.11 +    for (i=0; i<n; i++) {
    1.12 +        if (this->hidden->visuals[i].visual == DefaultVisual(SDL_Display, SDL_Screen)) return n;
    1.13 +    }
    1.14 +    this->hidden->visuals[n].depth = DefaultDepth(SDL_Display, SDL_Screen);;
    1.15 +    this->hidden->visuals[n].visual = DefaultVisual(SDL_Display, SDL_Screen);;
    1.16 +    this->hidden->nvisuals++;
    1.17 +    return(this->hidden->nvisuals);
    1.18 +}
    1.19  static int add_visual(_THIS, int depth, int class)
    1.20  {
    1.21      XVisualInfo vi;
    1.22 @@ -801,6 +813,7 @@
    1.23                                  add_visual(this, depth_list[i], StaticColor);
    1.24                          }
    1.25                  }
    1.26 +                add_default_visual(this);
    1.27          }
    1.28          if ( this->hidden->nvisuals == 0 ) {
    1.29              SDL_SetError("Found no sufficiently capable X11 visuals");