src/video/windib/SDL_dibevents.c
branchSDL-1.2
changeset 3981 b0d021cf41b6
parent 3868 b2f59aadec0d
child 4139 568c9b3c0167
     1.1 --- a/src/video/windib/SDL_dibevents.c	Tue Jun 26 00:57:09 2007 +0000
     1.2 +++ b/src/video/windib/SDL_dibevents.c	Tue Jun 26 20:02:40 2007 +0000
     1.3 @@ -225,9 +225,14 @@
     1.4  
     1.5  #if defined(SC_SCREENSAVE) && defined(SC_MONITORPOWER)
     1.6  		case WM_SYSCOMMAND: {
     1.7 -			if ((wParam&0xFFF0)==SC_SCREENSAVE ||
     1.8 -				(wParam&0xFFF0)==SC_MONITORPOWER)
     1.9 +			const DWORD val = (DWORD) (wParam & 0xFFF0);
    1.10 +			if ((val == SC_SCREENSAVE) || (val == SC_MONITORPOWER)) {
    1.11 +				if (!this->hidden->allow_screensaver) {
    1.12 +					/* Note that this doesn't stop anything on Vista
    1.13 +					   if the screensaver has a password. */
    1.14  					return(0);
    1.15 +				}
    1.16 +			}
    1.17  		}
    1.18  		/* Fall through to default processing */
    1.19  #endif /* SC_SCREENSAVE && SC_MONITORPOWER */