comparison src/video/x11/SDL_x11events.c @ 3040:62d4992e5a92

indent
author Sam Lantinga <slouken@libsdl.org>
date Wed, 14 Jan 2009 04:25:32 +0000
parents 86918831452f
children 51750b7a966f
comparison
equal deleted inserted replaced
3039:829043b363d1 3040:62d4992e5a92
308 xevent.xbutton.button); 308 xevent.xbutton.button);
309 break; 309 break;
310 } 310 }
311 continue; 311 continue;
312 } 312 }
313
314 #if SDL_VIDEO_DRIVER_X11_XINPUT 313 #if SDL_VIDEO_DRIVER_X11_XINPUT
315 data = (X11_MouseData *) mouse->driverdata; 314 data = (X11_MouseData *) mouse->driverdata;
316 if (xevent.type == data->motion) { 315 if (xevent.type == data->motion) {
317 XDeviceMotionEvent *move = 316 XDeviceMotionEvent *move =
318 (XDeviceMotionEvent *) & xevent; 317 (XDeviceMotionEvent *) & xevent;
396 395
397 /* Update activity every 30 seconds to prevent screensaver */ 396 /* Update activity every 30 seconds to prevent screensaver */
398 if (_this->suspend_screensaver) { 397 if (_this->suspend_screensaver) {
399 Uint32 now = SDL_GetTicks(); 398 Uint32 now = SDL_GetTicks();
400 if (!data->screensaver_activity || 399 if (!data->screensaver_activity ||
401 (int)(now-data->screensaver_activity) >= 30000) { 400 (int) (now - data->screensaver_activity) >= 30000) {
402 XResetScreenSaver(data->display); 401 XResetScreenSaver(data->display);
403 data->screensaver_activity = now; 402 data->screensaver_activity = now;
404 } 403 }
405 } 404 }
406 405
413 /* This is so wrong it hurts */ 412 /* This is so wrong it hurts */
414 #define GNOME_SCREENSAVER_HACK 413 #define GNOME_SCREENSAVER_HACK
415 #ifdef GNOME_SCREENSAVER_HACK 414 #ifdef GNOME_SCREENSAVER_HACK
416 #include <unistd.h> 415 #include <unistd.h>
417 static pid_t screensaver_inhibit_pid; 416 static pid_t screensaver_inhibit_pid;
418 static void gnome_screensaver_disable() 417 static void
418 gnome_screensaver_disable()
419 { 419 {
420 screensaver_inhibit_pid = fork(); 420 screensaver_inhibit_pid = fork();
421 if (screensaver_inhibit_pid == 0) { 421 if (screensaver_inhibit_pid == 0) {
422 close(0); 422 close(0);
423 close(1); 423 close(1);
424 close(2); 424 close(2);
425 execl("/usr/bin/gnome-screensaver-command", 425 execl("/usr/bin/gnome-screensaver-command",
426 "gnome-screensaver-command", 426 "gnome-screensaver-command",
427 "--inhibit", 427 "--inhibit",
428 "--reason", 428 "--reason",
429 "GNOME screensaver doesn't respect MIT-SCREEN-SAVER", 429 "GNOME screensaver doesn't respect MIT-SCREEN-SAVER", NULL);
430 NULL);
431 exit(2); 430 exit(2);
432 } 431 }
433 } 432 }
434 static void gnome_screensaver_enable() 433 static void
434 gnome_screensaver_enable()
435 { 435 {
436 kill(screensaver_inhibit_pid, 15); 436 kill(screensaver_inhibit_pid, 15);
437 } 437 }
438 #endif 438 #endif
439 439