X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Ftimers.c;h=b079492c9d5aaede661b97498bbc0df5613e0997;hp=97a26c02a39c5f4060135b51bda27fb217602d15;hb=50be9bb40dc60130c99ffa568e6677779904ff70;hpb=5f1f12f2a37da634000f96d18d59cc73a8814ef7 diff --git a/driver/timers.c b/driver/timers.c index 97a26c02..b079492c 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -709,7 +709,8 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) Bool polling_mouse_position = (si->using_proc_interrupts || !(si->using_xidle_extension || si->using_mit_saver_extension || - si->using_sgi_saver_extension)); + si->using_sgi_saver_extension) || + si->using_xinput_extension); if (until_idle_p) { @@ -1025,8 +1026,32 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) else #endif /* HAVE_SGI_SAVER_EXTENSION */ +#ifdef HAVE_XINPUT + if ((!until_idle_p) && (si->num_xinput_devices > 0) && + (event.x_event.type == si->xinput_DeviceMotionNotify || + event.x_event.type == si->xinput_DeviceButtonPress || + event.x_event.type == si->xinput_DeviceButtonRelease )) + { + + dispatch_event (si, &event.x_event); + if (si->demoing_p && + (event.x_event.type == si->xinput_DeviceMotionNotify || + event.x_event.type == si->xinput_DeviceButtonRelease) ) + /* When we're demoing a single hack, mouse motion doesn't + cause deactivation. Only clicks and keypresses do. */ + ; + else + /* If we're not demoing, then any activity causes deactivation. + */ + goto DONE; + } + else +#endif /* HAVE_XINPUT */ + #ifdef HAVE_RANDR - if (event.x_event.type == (si->randr_event_number + RRScreenChangeNotify)) + if (si->using_randr_extension && + (event.x_event.type == + (si->randr_event_number + RRScreenChangeNotify))) { /* The Resize and Rotate extension sends an event when the size, rotation, or refresh rate of any screen has changed.