Bug 23269

Summary: Subtle bug with two mice and selecting text
Product: xorg Reporter: Joel Feiner <jafeiner>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
0001-Add-EvdevPostButtonEvent-API-to-immediately-post-a-b.patch none

Description Joel Feiner 2009-08-12 06:39:46 UTC
I was going to file a bug report, but I'm not sure if this is a bug or a configuration issue, so I am posting it here first.

I have a ThinkPad, which has a TrackPoint, and I use a USB optical mouse.  When I left click to start selecting text with the optical mouse, and drag with the TrackPoint, the mouse moves, but no text is selected.  It works fine if I use the same pointing device to do the button press and the dragging.  I just can't mix the two.  This issue occurs regardless of which toolkit the application uses.

I am using evdev for the keyboard and the mouse.  The relevant sections of my xorg.conf are here (I am not using HAL for configuration):

Section "ServerLayout"
    Identifier     "X.org Configured"
    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Mouse1" "SendCoreEvents"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "evdev"
    Option      "CorePointer"
    Option      "Device" "/dev/input/by-path/pci-0000:00:1d.1-usb-0:1:1.0-event-mouse"
    Option      "Emulate3Buttons" "yes"
    Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "InputDevice"
    Identifier  "Mouse1"
    Driver      "evdev"
    Option      "SendCoreEvents" "true"
    Option      "Device" "/dev/input/by-path/platform-i8042-serio-1-event-mouse"
    Option      "Emulate3Buttons" "yes"
    Option      "ZAxisMapping" "4 5 6 7"
EndSection
Comment 1 Joel Feiner 2009-08-12 06:40:26 UTC
On Tue, Aug 11, 2009 at 08:34:46PM -0400, Joel Feiner wrote:
> > I just rebuilt the whole stack.  The issue persists.
> >
> > Make sure you take exactly the following steps:
> > 1) Press and hold the left mouse button with optical mouse, without  
> > moving the optical mouse or the other mouse
> > 2) Start moving the trackpoint...no text will be selected
> > 3) Move the optical mouse and text will begin to be selected from where  
> > the cursor ended up after step 2 (not where the mouse was when the left  
> > mouse button was originally pressed)
> >
> > Doing the inverse (converse?) operation starting with the trackpoint  
> > mouse buttons and then moving the optical mouse has the exact same 
> > results.
> >
> > Do you think my config is wrong?  I kind of had to hack the device  
> > sections so that I could have both trackpoint and USB mouse.
amusing. actually an evdev bug which explains why I didn't reproduce it with
my trackpad + touchpad (synapticd driver).

it works if you click and move device A before moving device B. If you just
click A but dont move, the middle button timer isn't posted to the
server until the next EV_SYN arrives from the device. Introduced with
69d6ff3e01263ce2d52ed18b08f054bf3fdb923c.

Please file a bug for this issue so I don't lose it, just copy/paste this
email into the first comment.

Cheers,
  Peter
Comment 2 Peter Hutterer 2009-08-12 21:47:56 UTC
Created attachment 28580 [details] [review]
0001-Add-EvdevPostButtonEvent-API-to-immediately-post-a-b.patch

Applies to latest git. The problem was simply that a left button event was held back for the middle mouse button emulation. When the expiry timer triggered, the event was enqueued but not posted to the server until the next physical event arrived.
Comment 3 Peter Hutterer 2009-08-13 17:44:59 UTC
pushed as 36064dca9097df896b4b1b49c9c68775f1728846

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.