X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fx11%2Ffg_gamemode_x11.c;h=5df4edc9533476e2ca17e9b20185bfb24d54ac79;hb=9b7930fcbb8dde80f9b6de15bf184f7dce1adb1f;hp=6130aeb76ac88f95f1018a333d7bc75abee9435d;hpb=5b3d339481bac6dbaeb599bffc1325f716585bfe;p=freeglut diff --git a/src/x11/fg_gamemode_x11.c b/src/x11/fg_gamemode_x11.c index 6130aeb..5df4edc 100644 --- a/src/x11/fg_gamemode_x11.c +++ b/src/x11/fg_gamemode_x11.c @@ -29,9 +29,9 @@ #include #include "../fg_internal.h" +#ifdef HAVE_X11_EXTENSIONS_XRANDR_H static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) { -#ifdef HAVE_X11_EXTENSIONS_XRANDR_H int event_base, error_base, ver_major, ver_minor, use_rate; XRRScreenConfiguration *xrr_config = 0; Status result = -1; @@ -46,7 +46,7 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) /* we only heed the rate if we CAN actually use it (Xrandr >= 1.1) and * the user actually cares about it (rate > 0) */ - use_rate = ( rate > 0 ) && ( ( ver_major >= 1 ) || + use_rate = ( rate > 0 ) && ( ( ver_major > 1 ) || ( ( ver_major == 1 ) && ( ver_minor >= 1 ) ) ); /* this loop is only so that the whole thing will be repeated if someone @@ -93,7 +93,7 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) if(res_idx == -1) break; /* no matching resolution */ -#if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) +#if ( RANDR_MAJOR > 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) if(use_rate) { rate = fgState.GameModeRefresh; @@ -118,7 +118,7 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) break; } -#if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) +#if ( RANDR_MAJOR > 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) if(use_rate) result = XRRSetScreenConfigAndRate(fgDisplay.pDisplay.Display, xrr_config, fgDisplay.pDisplay.RootWindow, res_idx, rot, rate, timestamp); @@ -137,9 +137,9 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) return 0; } -#endif /* HAVE_X11_EXTENSIONS_XRANDR_H */ return -1; } +#endif /* HAVE_X11_EXTENSIONS_XRANDR_H */ /* * Remembers the current visual settings, so that @@ -147,7 +147,9 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) */ void fgPlatformRememberState( void ) { +# if defined(HAVE_X11_EXTENSIONS_XRANDR_H) | defined(HAVE_X11_EXTENSIONS_XF86VMODE_H) int event_base, error_base; +# endif /* * Remember the current pointer location before going fullscreen @@ -176,7 +178,7 @@ void fgPlatformRememberState( void ) fgDisplay.pDisplay.prev_ysz = ssizes[curr].height; fgDisplay.pDisplay.prev_refresh = -1; -# if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) +# if ( RANDR_MAJOR > 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) if(fgState.GameModeRefresh != -1) { fgDisplay.pDisplay.prev_refresh = XRRConfigCurrentRate(xrr_config); }