This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

select() on a X11 connection



I'm running cygwin B20.1 with the X11R6.4 precompiled libraries.
The following code, which works under unix, never returns from
the select() calls. Any ideas?

Thanks,
Jim

----


testselect(Display *dpy, Window win)
{
  int fd;
  XEvent event;
  fd_set mask;

  XSelectInput(dpy, win, PointerMotionMask);

  fd = XConnectionNumber(dpy);
  while(1) {
    FD_ZERO(&mask);
    FD_SET(fd, &mask);
    if (select(fd+1, &mask, NULL, NULL, NULL) == -1) {
      perror("select");
      exit(1);
    }
    printf("select returned: %x\n", mask.fds_bits[0]);
    XNextEvent(dpy, &event);
    printf("event %d\n", event.type);
  }
}

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]