src/video/x11/SDL_x11events.c
changeset 7857 6388f5229bb7
parent 7839 d2804f8153fe
child 7885 a8bd63b33636
equal deleted inserted replaced
7856:cb37776926ad 7857:6388f5229bb7
   907     if (videodata && videodata->windowlist) {
   907     if (videodata && videodata->windowlist) {
   908         for (i = 0; i < videodata->numwindows; ++i) {
   908         for (i = 0; i < videodata->numwindows; ++i) {
   909             SDL_WindowData *data = videodata->windowlist[i];
   909             SDL_WindowData *data = videodata->windowlist[i];
   910             if (data && data->pending_focus != PENDING_FOCUS_NONE) {
   910             if (data && data->pending_focus != PENDING_FOCUS_NONE) {
   911                 Uint32 now = SDL_GetTicks();
   911                 Uint32 now = SDL_GetTicks();
   912                 if ( (int)(data->pending_focus_time-now) <= 0 ) {
   912                 if (SDL_TICKS_PASSED(now, data->pending_focus_time)) {
   913                     if ( data->pending_focus == PENDING_FOCUS_IN ) {
   913                     if ( data->pending_focus == PENDING_FOCUS_IN ) {
   914                         X11_DispatchFocusIn(data);
   914                         X11_DispatchFocusIn(data);
   915                     } else {
   915                     } else {
   916                         X11_DispatchFocusOut(data);
   916                         X11_DispatchFocusOut(data);
   917                     }
   917                     }
   961 
   961 
   962     /* Update activity every 30 seconds to prevent screensaver */
   962     /* Update activity every 30 seconds to prevent screensaver */
   963     if (_this->suspend_screensaver) {
   963     if (_this->suspend_screensaver) {
   964         Uint32 now = SDL_GetTicks();
   964         Uint32 now = SDL_GetTicks();
   965         if (!data->screensaver_activity ||
   965         if (!data->screensaver_activity ||
   966             (int) (now - data->screensaver_activity) >= 30000) {
   966             SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) {
   967             X11_XResetScreenSaver(data->display);
   967             X11_XResetScreenSaver(data->display);
   968 
   968 
   969             #if SDL_USE_LIBDBUS
   969             #if SDL_USE_LIBDBUS
   970             SDL_dbus_screensaver_tickle(_this);
   970             SDL_dbus_screensaver_tickle(_this);
   971             #endif
   971             #endif