Does anyone disagree that 5327 is a bug which needs to be fixed?

Matthieu Herrb matthieu.herrb at laas.fr
Wed Jan 18 23:31:14 PST 2006


Deron Johnson wrote:
> https://bugs.freedesktop.org/show_bug.cgi?id=5327
> 
> Basically, what is happening is that every time the user moves the mouse
> wheel button press and release events are generated with button numbers
> 4 or 5 (depending on the direction of the wheel movement). These events
> are repeatedly triggering the default button grab and terminating the
> grab. This is a waste of cycles. It seems to me that triggering a grab
> on a mouse wheel movement is contrary to the X11 protocol. I am willing
> to fix this. Does anybody disagree that it needs to be fixed?
> 
> Here is the patch do events.c:DeliverEventsToWindow:
> 
> *** events.c.unfixed	Wed Jan 18 16:49:29 2006
> --- events.c.fixed	Wed Jan 18 16:51:27 2006
> ***************
> *** 1764,1770 ****
>   	    }
>   	}
>       }
> !     if ((type == ButtonPress) && deliveries && (!grab))
>       {
>   	GrabRec tempGrab;
> 
> --- 1764,1771 ----
>   	    }
>   	}
>       }
> !     if ((type == ButtonPress) && deliveries && (!grab) &&
> ! 	(pEvents->u.u.detail < 4))
>       {
>   	GrabRec tempGrab;
> 

Hard-coding '4' here looks really wrong. The code should get the 
ZAxisMapping information from the input device configuration to 
determine if a button is a wheel one or a regular one.

Mapping mouse wheel motion to button events is the only way that many 
existing applications have to support the wheel. Does this patch change 
the behaviour of such applications?
-- 
Matthieu Herrb



More information about the xorg mailing list