View | Details | Raw Unified | Return to bug 619034
Collapse All | Expand All

(-)a/dix/events.c (-50 / +2 lines)
Lines 3420-3426 CheckPassiveGrabsOnWindow( Link Here
3420
    {
3420
    {
3421
	DeviceIntPtr	gdev;
3421
	DeviceIntPtr	gdev;
3422
	XkbSrvInfoPtr	xkbi = NULL;
3422
	XkbSrvInfoPtr	xkbi = NULL;
3423
	Mask		mask = 0;
3424
3423
3425
	gdev= grab->modifierDevice;
3424
	gdev= grab->modifierDevice;
3426
        if (grab->grabtype == GRABTYPE_CORE)
3425
        if (grab->grabtype == GRABTYPE_CORE)
Lines 3535-3543 CheckPassiveGrabsOnWindow( Link Here
3535
                }
3534
                }
3536
                xE = &core;
3535
                xE = &core;
3537
                count = 1;
3536
                count = 1;
3538
                mask = grab->eventMask;
3539
                if (grab->ownerEvents)
3540
                    mask |= pWin->eventMask;
3541
            } else if (match & XI2_MATCH)
3537
            } else if (match & XI2_MATCH)
3542
            {
3538
            {
3543
                rc = EventToXI2((InternalEvent*)event, &xE);
3539
                rc = EventToXI2((InternalEvent*)event, &xE);
Lines 3549-3582 CheckPassiveGrabsOnWindow( Link Here
3549
                    continue;
3545
                    continue;
3550
                }
3546
                }
3551
                count = 1;
3547
                count = 1;
3552
3553
                /* FIXME: EventToXI2 returns NULL for enter events, so
3554
                 * dereferencing the event is bad. Internal event types are
3555
                 * aligned with core events, so the else clause is valid.
3556
                 * long-term we should use internal events for enter/focus
3557
                 * as well */
3558
                if (xE)
3559
                    mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
3560
                else if (event->type == XI_Enter || event->type == XI_FocusIn)
3561
                    mask = grab->xi2mask[device->id][event->type/8];
3562
3563
                if (grab->ownerEvents && wOtherInputMasks(grab->window))
3564
                {
3565
                    InputClientsPtr icp =
3566
                        wOtherInputMasks(grab->window)->inputClients;
3567
3568
                    while(icp)
3569
                    {
3570
                        if (rClient(icp) == rClient(grab))
3571
                        {
3572
                            int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
3573
                            mask |= icp->xi2mask[device->id][evtype/8];
3574
                            break;
3575
                        }
3576
3577
                        icp = icp->next;
3578
                    }
3579
                }
3580
            } else
3548
            } else
3581
            {
3549
            {
3582
                rc = EventToXI((InternalEvent*)event, &xE, &count);
3550
                rc = EventToXI((InternalEvent*)event, &xE, &count);
Lines 3587-3609 CheckPassiveGrabsOnWindow( Link Here
3587
                                "(%d, %d).\n", device->name, event->type, rc);
3555
                                "(%d, %d).\n", device->name, event->type, rc);
3588
                    continue;
3556
                    continue;
3589
                }
3557
                }
3590
                mask = grab->eventMask;
3591
                if (grab->ownerEvents && wOtherInputMasks(grab->window))
3592
                {
3593
                    InputClientsPtr icp =
3594
                        wOtherInputMasks(grab->window)->inputClients;
3595
3596
                    while(icp)
3597
                    {
3598
                        if (rClient(icp) == rClient(grab))
3599
                        {
3600
                            mask |= icp->mask[device->id];
3601
                            break;
3602
                        }
3603
3604
                        icp = icp->next;
3605
                    }
3606
                }
3607
            }
3558
            }
3608
3559
3609
	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
3560
	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
Lines 3612-3618 CheckPassiveGrabsOnWindow( Link Here
3612
            {
3563
            {
3613
                FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
3564
                FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
3614
3565
3615
                TryClientEvents(rClient(grab), device, xE, count, mask,
3566
                TryClientEvents(rClient(grab), device, xE, count,
3567
                                       GetEventFilter(device, xE),
3616
                                       GetEventFilter(device, xE), grab);
3568
                                       GetEventFilter(device, xE), grab);
3617
            }
3569
            }

Return to bug 619034