aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaddy <naddy@FreeBSD.org>2012-04-25 01:28:04 +0800
committernaddy <naddy@FreeBSD.org>2012-04-25 01:28:04 +0800
commitb13199649b535ab40691f2c74111e34ecfdd2f8c (patch)
tree4f4ebb698cfbbd65baa7430125d9efca9aa273cf
parent03c6632213fb35660576b3aa2ac068308ef8cae8 (diff)
downloadfreebsd-ports-gnome-b13199649b535ab40691f2c74111e34ecfdd2f8c.tar.gz
freebsd-ports-gnome-b13199649b535ab40691f2c74111e34ecfdd2f8c.tar.zst
freebsd-ports-gnome-b13199649b535ab40691f2c74111e34ecfdd2f8c.zip
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
-rw-r--r--x11-servers/xorg-server/Makefile3
-rw-r--r--x11-servers/xorg-server/files/extra-dix_events.c89
2 files changed, 91 insertions, 1 deletions
diff --git a/x11-servers/xorg-server/Makefile b/x11-servers/xorg-server/Makefile
index cb5663c7d092..12ed40b330ec 100644
--- a/x11-servers/xorg-server/Makefile
+++ b/x11-servers/xorg-server/Makefile
@@ -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
diff --git a/x11-servers/xorg-server/files/extra-dix_events.c b/x11-servers/xorg-server/files/extra-dix_events.c
new file mode 100644
index 000000000000..caa7a99ec255
--- /dev/null
+++ b/x11-servers/xorg-server/files/extra-dix_events.c
@@ -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);
+ }
+