An attempt at fixing a bug involving DGA and mouse buttons

Ville Syrjälä syrjala at sci.fi
Mon Jan 7 14:18:16 PST 2013


On Sat, Aug 25, 2012 at 04:47:42PM -0500, Steven Elliott wrote:
> On Fri, 2012-08-24 at 12:29 +1000, Peter Hutterer wrote:
> > we can't drop this block, it is central to button handling with multiple
> > devices. right now, if you hold a button on the mouse and the touchpad, the
> > logical button will only be released once _both_ buttons are up. this is
> > behaviour we had since 1.7 (at least), I don't really want to change it.
> > 
> > A better fix is what Ville suggested, that sounds like the right thing to
> > do.
> 
> The attached patch does that.  It no longer removes the block of code in
> question.  It moves only the 
>     if (!IsMaster(keybd))
>        return;
> from inside DGAHandleEvent() to inside DGAProcessKeyboardEvent() and
> DGAProcessPointerEvent() after the call to UpdateDeviceState() in those
> functions like Ville suggested.  
> 
> I've attached an updated patch which fixes the problem for me.  This
> time I generated the patch with the latest from git with
> git-format-patch in the interest of following the patch submission
> guidelines a bit more than I did last time.

Hmm. What happened to this patch? Looks like it never got applied to
master.

> 
> -- 
> ------------------------------------------------------------------------
> |  Steven Elliott  |  http://selliott.org  |  selliott4 at austin.rr.com  |
> ------------------------------------------------------------------------

> From a31fb95821d0308dd6882eb67429d39e851e29b4 Mon Sep 17 00:00:00 2001
> From: Steven Elliott <selliott4 at austin.rr.com>
> Date: Sat, 25 Aug 2012 15:44:33 -0500
> Subject: [PATCH] Fixes a problem where mouse buttons get stuck
>  down when DGA is engaged (has a handler).
> 
> ---
>  hw/xfree86/common/xf86DGA.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
> index a441dee..1af8d2e 100644
> --- a/hw/xfree86/common/xf86DGA.c
> +++ b/hw/xfree86/common/xf86DGA.c
> @@ -1033,6 +1033,9 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
>  
>      UpdateDeviceState(keybd, &ev);
>  
> +    if (!IsMaster(keybd))
> +	return;
> +
>      /*
>       * Deliver the DGA event
>       */
> @@ -1074,6 +1077,7 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
>      DeviceEvent ev = {
>          .header = ET_Internal,
>          .length = sizeof(ev),
> +        .detail.key = event->detail,
>          .type = event->subtype,
>          .corestate = butc ? butc->state : 0
>      };
> @@ -1083,6 +1087,9 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
>  
>      UpdateDeviceState(mouse, &ev);
>  
> +    if (!IsMaster(mouse))
> +	return;
> +
>      /*
>       * Deliver the DGA event
>       */
> @@ -1190,9 +1197,6 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device)
>      if (!pScreenPriv)
>          return;
>  
> -    if (!IsMaster(device))
> -        return;
> -
>      switch (event->subtype) {
>      case KeyPress:
>      case KeyRelease:
> -- 
> 1.7.7.6
> 

> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


-- 
Ville Syrjälä
syrjala at sci.fi
http://www.sci.fi/~syrjala/


More information about the xorg-devel mailing list