Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11events.c @ 1659:14717b52abc0 SDL-1.3
Merge trunk-1.3-3
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 17 May 2006 08:18:28 +0000 |
parents | e49147870aac |
children | 782fd950bd46 |
comparison
equal
deleted
inserted
replaced
1658:e49147870aac | 1659:14717b52abc0 |
---|---|
289 #endif | 289 #endif |
290 if ( (xevent.xcrossing.mode != NotifyGrab) && | 290 if ( (xevent.xcrossing.mode != NotifyGrab) && |
291 (xevent.xcrossing.mode != NotifyUngrab) ) { | 291 (xevent.xcrossing.mode != NotifyUngrab) ) { |
292 if ( this->input_grab == SDL_GRAB_OFF ) { | 292 if ( this->input_grab == SDL_GRAB_OFF ) { |
293 posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); | 293 posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); |
294 } else { | 294 } |
295 posted = SDL_PrivateMouseMotion(0, 0, | 295 posted = SDL_PrivateMouseMotion(0, 0, |
296 xevent.xcrossing.x, | 296 xevent.xcrossing.x, |
297 xevent.xcrossing.y); | 297 xevent.xcrossing.y); |
298 } | |
299 } | 298 } |
300 } | 299 } |
301 break; | 300 break; |
302 | 301 |
303 /* Losing mouse coverage? */ | 302 /* Losing mouse coverage? */ |
1116 void X11_InitOSKeymap(_THIS) | 1115 void X11_InitOSKeymap(_THIS) |
1117 { | 1116 { |
1118 X11_InitKeymap(); | 1117 X11_InitKeymap(); |
1119 } | 1118 } |
1120 | 1119 |
1120 void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms) | |
1121 { | |
1122 int timeout, interval, prefer_blank, allow_exp; | |
1123 XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp); | |
1124 *saved_timeout = timeout; | |
1125 | |
1126 #if SDL_VIDEO_DRIVER_X11_DPMS | |
1127 if ( SDL_X11_HAVE_DPMS ) { | |
1128 int dummy; | |
1129 if ( DPMSQueryExtension(display, &dummy, &dummy) ) { | |
1130 CARD16 state; | |
1131 DPMSInfo(display, &state, dpms); | |
1132 } | |
1133 } | |
1134 #else | |
1135 *dpms = 0; | |
1136 #endif /* SDL_VIDEO_DRIVER_X11_DPMS */ | |
1137 } | |
1138 | |
1139 void X11_DisableScreenSaver(Display *display) | |
1140 { | |
1141 int timeout, interval, prefer_blank, allow_exp; | |
1142 XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp); | |
1143 timeout = 0; | |
1144 XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp); | |
1145 | |
1146 #if SDL_VIDEO_DRIVER_X11_DPMS | |
1147 if ( SDL_X11_HAVE_DPMS ) { | |
1148 int dummy; | |
1149 if ( DPMSQueryExtension(display, &dummy, &dummy) ) { | |
1150 DPMSDisable(display); | |
1151 } | |
1152 } | |
1153 #endif /* SDL_VIDEO_DRIVER_X11_DPMS */ | |
1154 } | |
1155 | |
1156 void X11_RestoreScreenSaver(Display *display, int saved_timeout, BOOL dpms) | |
1157 { | |
1158 int timeout, interval, prefer_blank, allow_exp; | |
1159 XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp); | |
1160 timeout = saved_timeout; | |
1161 XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp); | |
1162 | |
1163 #if SDL_VIDEO_DRIVER_X11_DPMS | |
1164 if ( SDL_X11_HAVE_DPMS ) { | |
1165 int dummy; | |
1166 if ( DPMSQueryExtension(display, &dummy, &dummy) ) { | |
1167 if ( dpms ) { | |
1168 DPMSEnable(display); | |
1169 } | |
1170 } | |
1171 } | |
1172 #endif /* SDL_VIDEO_DRIVER_X11_DPMS */ | |
1173 } |