[patch] EmulateWheel button press broken

Matthias Hopf mhopf at suse.de
Fri Jan 13 07:02:50 PST 2006


On Jan 12, 06 14:23:19 -0800, Andrew Pimlott wrote:
> As reported in two Debian bug reports [1] [2], the ability for the
> EmulateWheelButton to generate button events was broken shortly before
> the 6.9 release.  It is still broken in current Debian unstable package
> 6.9.0.dfsg.1-3, and I believe it is still broken in x.org CVS.

Yes, my fault. I cleaned up too much.
Xorg bugzilla #5071, including suggested fix. I'll commit it shortly
after I checked it works with the modular tree as well.

> xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c.  The problem is the
> removal of the truebuttons variable.  The wheel emulation code in
> MouseDoPostEvent modifies buttons to mask out EmulateWheelButton,
> therefore the if condition
> 
>     if (buttons != pMse->lastMappedButtons) {
> 
> (line 2256) was failing when the EmulateWheelButton was pressed,
> therefore
> 
>     pMse->lastMappedButtons = buttons;
> 
> (line 2359) was not being run, therefore when the EmulateWheelButton was
> released,
> 
>     change = buttons ^ pMse->lastMappedButtons;
> 
> (line 2162) thought there was no change, therefore the button press was
> not generated.

My change will have the similar effect, but I didn't want to re-include
the truebutton variable - which is IMHO broken anyway.

In any case, I would appreciate comments whether my patch works for you
as well.

> The appended patch fixes this by restoring truebuttons (which I called
> origbuttons to be slightly clearer).  The logic is very similar to
> before 1.15, and it does not appear to interfere with the mapping
> changes in 1.15, so I don't think it will introduce any problems that
> weren't already there.  I tested that I can now generate a button press
> with EmulateWheelButton.

Before 1.15 there were several bugs lurking in that code, and I'm not
entirely convinced that your code doesn't produce false mouse button
events (like the old code did) in some strange corner cases.

Thanks

Matthias

-- 
Matthias Hopf <mhopf at suse.de>       __        __   __
Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de



More information about the xorg mailing list