src/video/x11/SDL_x11modes.c
changeset 10499 363c1c7e7a41
parent 10437 d62c4978fffa
child 10586 c8ca00149330
     1.1 --- a/src/video/x11/SDL_x11modes.c	Fri Sep 30 09:26:57 2016 -0400
     1.2 +++ b/src/video/x11/SDL_x11modes.c	Fri Oct 07 23:40:44 2016 -0700
     1.3 @@ -157,14 +157,12 @@
     1.4  {
     1.5      int event_base = 0;
     1.6      int error_base = 0;
     1.7 -    const char *env;
     1.8  
     1.9      /* Default the extension not available */
    1.10      *major = *minor = 0;
    1.11  
    1.12      /* Allow environment override */
    1.13 -    env = SDL_GetHint(SDL_HINT_VIDEO_X11_XINERAMA);
    1.14 -    if (env && !SDL_atoi(env)) {
    1.15 +    if (!SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_XINERAMA, SDL_TRUE)) {
    1.16  #ifdef X11MODES_DEBUG
    1.17          printf("Xinerama disabled due to hint\n");
    1.18  #endif
    1.19 @@ -213,22 +211,19 @@
    1.20  static SDL_bool
    1.21  CheckXRandR(Display * display, int *major, int *minor)
    1.22  {
    1.23 -    const char *env;
    1.24 -
    1.25      /* Default the extension not available */
    1.26      *major = *minor = 0;
    1.27  
    1.28      /* Allow environment override */
    1.29 -    env = SDL_GetHint(SDL_HINT_VIDEO_X11_XRANDR);
    1.30  #ifdef XRANDR_DISABLED_BY_DEFAULT
    1.31 -    if (!env || !SDL_atoi(env)) {
    1.32 +    if (!SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_XRANDR, SDL_FALSE)) {
    1.33  #ifdef X11MODES_DEBUG
    1.34          printf("XRandR disabled by default due to window manager issues\n");
    1.35  #endif
    1.36          return SDL_FALSE;
    1.37      }
    1.38  #else
    1.39 -    if (env && !SDL_atoi(env)) {
    1.40 +    if (!SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_XRANDR, SDL_TRUE)) {
    1.41  #ifdef X11MODES_DEBUG
    1.42          printf("XRandR disabled due to hint\n");
    1.43  #endif
    1.44 @@ -507,14 +502,11 @@
    1.45  static SDL_bool
    1.46  CheckVidMode(Display * display, int *major, int *minor)
    1.47  {
    1.48 -    const char *env;
    1.49 -
    1.50      /* Default the extension not available */
    1.51      *major = *minor = 0;
    1.52  
    1.53      /* Allow environment override */
    1.54 -    env = SDL_GetHint(SDL_HINT_VIDEO_X11_XVIDMODE);
    1.55 -    if (env && !SDL_atoi(env)) {
    1.56 +    if (!SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_XVIDMODE, SDL_TRUE)) {
    1.57  #ifdef X11MODES_DEBUG
    1.58          printf("XVidMode disabled due to hint\n");
    1.59  #endif
    1.60 @@ -622,8 +614,7 @@
    1.61         we sort out the ramifications of removing XVidMode support outright.
    1.62         This block should be removed with the XVidMode support. */
    1.63      {
    1.64 -        const char *env = SDL_GetHint("SDL_VIDEO_X11_REQUIRE_XRANDR");
    1.65 -        if (env && SDL_atoi(env)) {
    1.66 +        if (SDL_GetHintBoolean("SDL_VIDEO_X11_REQUIRE_XRANDR", SDL_FALSE)) {
    1.67              #if SDL_VIDEO_DRIVER_X11_XRANDR
    1.68              return SDL_SetError("XRandR support is required but not available");
    1.69              #else