Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2012 13:03:17 +0200
From:      Christian Weisgerber <naddy@freebsd.org>
To:        freebsd-x11@freebsd.org
Subject:   xorg-server: restore patch-dix-events.c
Message-ID:  <20120424110317.GA60583@lorvorc.mips.inka.de>

next in thread | raw e-mail | index | archive | help
In the Xorg 7.5.2 update, patch-dix-events.c was lost, although it
is still required for xorg-server-1.7.7.

---->
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).
<----

Unless there are objections I will commit this in 24 hours.

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/x11-servers/xorg-server/Makefile,v
retrieving revision 1.85
diff -u -r1.85 Makefile
--- Makefile	21 Apr 2012 17:03:31 -0000	1.85
+++ Makefile	24 Apr 2012 11:01:02 -0000
@@ -31,8 +31,9 @@
 		${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
Index: files/extra-dix_events.c
===================================================================
RCS file: files/extra-dix_events.c
diff -N files/extra-dix_events.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/extra-dix_events.c	24 Apr 2012 11:01:02 -0000
@@ -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);
+             }
+ 
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120424110317.GA60583>