Browse Source

Read first events

Olivier Marty 9 years ago
parent
commit
9bee64fc3e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      main.c

+ 4 - 1
main.c

@@ -295,7 +295,10 @@ int main(int argc, char **argv)
       fd_set in_fds;
       FD_ZERO(&in_fds);
       FD_SET(penv.d_fd, &in_fds);
-      if(state == S_PAUSED) // blocking select
+      if(XPending(penv.d)) // event waiting (pselect does no see events that come
+      // during the beginning of the program
+        value = 1;
+      else if(state == S_PAUSED) // blocking select
         value = pselect(penv.d_fd+1, &in_fds, NULL, NULL, NULL, NULL);
       else // timeout
       {