1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

Revert "dix: use the event mask of the grab for TryClientEvents."

http://cgit.freedesktop.org/xorg/xserver/commit/?id=018c878e9495b21146c8f38617fdd1bf6d8cc73b

This fixes delivery of button press events to clients.
In particular, it fixes irrecoverable focus loss in mwm(1).

Approved by:	miwi
Obtained from:	Xorg upstream
This commit is contained in:
Christian Weisgerber 2012-04-24 17:28:04 +00:00
parent b13318799b
commit ca030a712f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=295417
2 changed files with 91 additions and 1 deletions

View File

@ -31,8 +31,9 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-hw_dmx_glxProxy_compsize.h \
${FILESDIR}/extra-hw_dmx_glxProxy_glxcmds.h
.else
XORG_VERSION= 1.7.7
XORG_REVISION= 4
XORG_REVISION= 5
PLIST_SUB+= OLD="" NEW="@comment "
EXTRA_PATCHES+= ${FILESDIR}/extra-dix_events.c
EXTRA_PATCHES+= ${FILESDIR}/extra-include_eventstr.h
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-os-utils.c
.endif

View File

@ -0,0 +1,89 @@
--- dix/events.c.orig 2010-05-04 02:47:57.000000000 +0200
+++ dix/events.c 2012-04-24 12:59:22.000000000 +0200
@@ -3440,7 +3440,6 @@ CheckPassiveGrabsOnWindow(
{
DeviceIntPtr gdev;
XkbSrvInfoPtr xkbi = NULL;
- Mask mask = 0;
gdev= grab->modifierDevice;
if (grab->grabtype == GRABTYPE_CORE)
@@ -3555,9 +3554,6 @@ CheckPassiveGrabsOnWindow(
}
xE = &core;
count = 1;
- mask = grab->eventMask;
- if (grab->ownerEvents)
- mask |= pWin->eventMask;
} else if (match & XI2_MATCH)
{
rc = EventToXI2((InternalEvent*)event, &xE);
@@ -3569,34 +3565,6 @@ CheckPassiveGrabsOnWindow(
continue;
}
count = 1;
-
- /* FIXME: EventToXI2 returns NULL for enter events, so
- * dereferencing the event is bad. Internal event types are
- * aligned with core events, so the else clause is valid.
- * long-term we should use internal events for enter/focus
- * as well */
- if (xE)
- mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
- else if (event->type == XI_Enter || event->type == XI_FocusIn)
- mask = grab->xi2mask[device->id][event->type/8];
-
- if (grab->ownerEvents && wOtherInputMasks(grab->window))
- {
- InputClientsPtr icp =
- wOtherInputMasks(grab->window)->inputClients;
-
- while(icp)
- {
- if (rClient(icp) == rClient(grab))
- {
- int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
- mask |= icp->xi2mask[device->id][evtype/8];
- break;
- }
-
- icp = icp->next;
- }
- }
} else
{
rc = EventToXI((InternalEvent*)event, &xE, &count);
@@ -3607,23 +3575,6 @@ CheckPassiveGrabsOnWindow(
"(%d, %d).\n", device->name, event->type, rc);
continue;
}
- mask = grab->eventMask;
- if (grab->ownerEvents && wOtherInputMasks(grab->window))
- {
- InputClientsPtr icp =
- wOtherInputMasks(grab->window)->inputClients;
-
- while(icp)
- {
- if (rClient(icp) == rClient(grab))
- {
- mask |= icp->mask[device->id];
- break;
- }
-
- icp = icp->next;
- }
- }
}
(*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
@@ -3632,7 +3583,8 @@ CheckPassiveGrabsOnWindow(
{
FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
- TryClientEvents(rClient(grab), device, xE, count, mask,
+ TryClientEvents(rClient(grab), device, xE, count,
+ GetEventFilter(device, xE),
GetEventFilter(device, xE), grab);
}