XI_Leave missing

Artem Ananiev Artem.Ananiev at Sun.COM
Sat Feb 27 05:00:08 PST 2010


Hello,

with a simple test - see the code snippet below - I successfully receive 
XI_Enter notifications for my window, but XI_Leave are missed. Are there 
any problems with the test, or something else is wrong?

----

   display = XOpenDisplay(NULL);

   root = RootWindow(display, 0);
   window = XCreateSimpleWindow(display, root,
                                100, 100, 320, 240,
                                BlackPixel(display, 0),
                                WhitePixel(display, 0));

   eventmask.deviceid = XIAllMasterDevices;
   eventmask.mask_len = sizeof(mask);
   eventmask.mask = mask;

   XISetMask(mask, XI_Enter);
   XISetMask(mask, XI_Leave);
   XISelectEvents(display, window, &eventmask, 1);

   XMapWindow(display, window);
   XSync(display, True);

   while (1) {
     XNextEvent(display, &xev);
     if ((xev.xcookie.type == GenericEvent) &&
         (xev.xcookie.extension == xinput_opcode) &&
         XGetEventData(display, &xev.xcookie)) {
       switch (xev.xcookie.evtype) {
         case XI_Enter:
           fprintf(stderr, "XI_Enter\n");
           break;
         case XI_Leave:
           fprintf(stderr, "XI_Leave\n");
           break;
       }
       XFreeEventData(display, &xev.xcookie);
     }
   }

----

The problem is reproducible both with a single master device and with 
multiple ones. If I modify the test to listen for regular EnterNotify 
and LeaveNotify, these are received correctly (but XI_Leave is still 
missed).

Any ideas?

Thanks,

Artem



More information about the xorg-devel mailing list