Bug 24887

Summary: Remapping buttons with xinput --set-button-map makes buttons get stuck
Product: xorg Reporter: Dani Church <dani.church>
Component: Server/Input/CoreAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium CC: ejsherry
Version: 7.5 (2009.10)   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Dani Church 2009-11-03 16:54:51 UTC
Using server 1.7.1, if I remap buttons on my USB mouse using xinput, the server doesn't process button release events in certain cases.  So, clients don't get the ButtonRelease event, and the server maintains focus on the client window because it believes a mouse button is still held down.

Specifically, the server will not process a button release for remapped button N if physical button N is currently held down.  So, if I execute:

xinput --set-button-map 'Mouse' 2 3 1

then I can press the right mouse button, press the middle, release the right, and release the middle, and get the following events, as expected:

ButtonPress event, state 0x0, button 1
ButtonPress event, state 0x100, button 3
ButtonRelease event, state 0x500, button 1
ButtonRelease event, state 0x400, button 3

But if I press the buttons in reverse order, middle then right, I only get three events:

ButtonPress event, state 0x0, button 3
ButtonPress event, state 0x400, button 1
  -- (missing event should go here) --
ButtonRelease event, state 0x500, button 1

If I later press and release the middle mouse button, I don't get a second ButtonPress for button 3, but I do get the missing ButtonRelease.

ButtonRelease event, state 0x400, button 3

This happens with both the evdev driver and the mouse driver, but it does not happen if I use xmodmap to remap the pointer buttons.
Comment 1 Jesse Adkins 2010-12-06 20:17:14 UTC
Fixed today in git master.

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.