* Remember the current ViewPort location of the screen to be able to
* restore the ViewPort on LeaveGameMode():
*/
- XF86VidModeGetViewPort(
- fgDisplay.Display,
- fgDisplay.Screen,
- &fgDisplay.DisplayViewPortX,
- &fgDisplay.DisplayViewPortY
- );
+ if( !XF86VidModeGetViewPort(
+ fgDisplay.Display,
+ fgDisplay.Screen,
+ &fgDisplay.DisplayViewPortX,
+ &fgDisplay.DisplayViewPortY ) )
+ fgWarning( "XF86VidModeGetViewPort failed" );
/*
* Remember the current pointer location before going fullscreen
);
if( !fgDisplay.DisplayModeValid )
- fgWarning( "Runtime use of XF86VidModeGetModeLine failed." );
+ fgWarning( "XF86VidModeGetModeLine failed" );
# else
/*
XF86VidModeModeInfo** displayModes;
int i, displayModesCount;
- XF86VidModeGetAllModeLines(
- fgDisplay.Display,
- fgDisplay.Screen,
- &displayModesCount,
- &displayModes
- );
+ if( !XF86VidModeGetAllModeLines(
+ fgDisplay.Display,
+ fgDisplay.Screen,
+ &displayModesCount,
+ &displayModes ) )
+ {
+ fgWarning( "XF86VidModeGetAllModeLines failed" );
+ return;
+ }
+
/*
* Check every of the modes looking for one that matches our demands.
displayModes[ i ]->vdisplay == fgDisplay.DisplayMode.vdisplay &&
displayModes[ i ]->dotclock == fgDisplay.DisplayModeClock )
{
- XF86VidModeSwitchToMode(
- fgDisplay.Display,
- fgDisplay.Screen,
- displayModes[ i ]
- );
- XF86VidModeSetViewPort(
- fgDisplay.Display,
- fgDisplay.Screen,
- fgDisplay.DisplayViewPortX,
- fgDisplay.DisplayViewPortY
- );
+ if( !XF86VidModeSwitchToMode(
+ fgDisplay.Display,
+ fgDisplay.Screen,
+ displayModes[ i ] ) )
+ {
+ fgWarning( "XF86VidModeSwitchToMode failed" );
+ break;
+ }
+
+ if( !XF86VidModeSetViewPort(
+ fgDisplay.Display,
+ fgDisplay.Screen,
+ fgDisplay.DisplayViewPortX,
+ fgDisplay.DisplayViewPortY ) )
+ fgWarning( "XF86VidModeSetViewPort failed" );
+
/*
* For the case this would be the last X11 call the application
XF86VidModeModeInfo** displayModes;
int i, ignoreRefreshRate, displayModesCount;
- XF86VidModeGetAllModeLines(
- fgDisplay.Display,
- fgDisplay.Screen,
- &displayModesCount,
- &displayModes
- );
+ if( !XF86VidModeGetAllModeLines(
+ fgDisplay.Display,
+ fgDisplay.Screen,
+ &displayModesCount,
+ &displayModes ) )
+ {
+ fgWarning( "XF86VidModeGetAllModeLines failed" );
+ return success;
+ }
+
/*
* Check every of the modes looking for one that matches our demands,
}
if( !haveToTest && success ) {
- XF86VidModeSwitchToMode( fgDisplay.Display, fgDisplay.Screen, displayModes[ i ] );
+ if( !XF86VidModeSwitchToMode(
+ fgDisplay.Display,
+ fgDisplay.Screen,
+ displayModes[ i ] ) )
+ fgWarning( "XF86VidModeSwitchToMode failed" );
}
XFree( displayModes );
Window child;
/* Change to viewport to the window topleft edge: */
- XF86VidModeSetViewPort( fgDisplay.Display, fgDisplay.Screen, 0, 0 );
+ if( !XF86VidModeSetViewPort( fgDisplay.Display, fgDisplay.Screen, 0, 0 ) )
+ fgWarning( "XF86VidModeSetViewPort failed" );
/*
* Final window repositioning: It could be avoided using an undecorated