From owner-freebsd-x11@FreeBSD.ORG Tue Apr 24 11:34:19 2012 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2966106564A for ; Tue, 24 Apr 2012 11:34:19 +0000 (UTC) (envelope-from naddy@mips.inka.de) Received: from mail-in-17.arcor-online.net (mail-in-17.arcor-online.net [151.189.21.57]) by mx1.freebsd.org (Postfix) with ESMTP id 88FF58FC08 for ; Tue, 24 Apr 2012 11:34:19 +0000 (UTC) Received: from mail-in-02-z2.arcor-online.net (mail-in-02-z2.arcor-online.net [151.189.8.14]) by mx.arcor.de (Postfix) with ESMTP id B474CCC288 for ; Tue, 24 Apr 2012 13:03:17 +0200 (CEST) Received: from mail-in-14.arcor-online.net (mail-in-14.arcor-online.net [151.189.21.54]) by mail-in-02-z2.arcor-online.net (Postfix) with ESMTP id B05A417547D for ; Tue, 24 Apr 2012 13:03:17 +0200 (CEST) Received: from lorvorc.mips.inka.de (dslb-092-075-214-019.pools.arcor-ip.net [92.75.214.19]) by mail-in-14.arcor-online.net (Postfix) with ESMTPS id 812CB9C3D6 for ; Tue, 24 Apr 2012 13:03:17 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-14.arcor-online.net 812CB9C3D6 Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.14.5/8.14.3) with ESMTP id q3OB3HnT061953 for ; Tue, 24 Apr 2012 13:03:17 +0200 (CEST) (envelope-from naddy@lorvorc.mips.inka.de) Received: (from naddy@localhost) by lorvorc.mips.inka.de (8.14.5/8.14.5/Submit) id q3OB3Hxs061952 for freebsd-x11@freebsd.org; Tue, 24 Apr 2012 13:03:17 +0200 (CEST) (envelope-from naddy) Date: Tue, 24 Apr 2012 13:03:17 +0200 From: Christian Weisgerber To: freebsd-x11@freebsd.org Message-ID: <20120424110317.GA60583@lorvorc.mips.inka.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Subject: xorg-server: restore patch-dix-events.c X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2012 11:34:20 -0000 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