Does KDE Desktop want a full-width mouse/pointer Button State mask?

Rick Stockton rickstockton at reno-computerhelp.com
Wed Jul 11 03:17:05 BST 2012


It's awfully late for an API change to Qt5, but this would be an awkward 
Backward Compatibility problem to attempt in later Qt5 Releases: Should 
Qt5 present a 32-bit Button State mask?

** Background **
  As you all remember, I added "more mouse buttons" for MouseButtonPress 
and MouseButtonRelease events into Qt5 between December and March. The 
number of buttons varies according to the Platform Plugin, which (IIRC, 
SWAG) is as follows:

  Wayland, XCB using X11's evdev driver, OS-X "Cocoa": 16 buttons maximum
  QNX: 8 buttons
  Windows: 5 buttons (i.e., no change from Qt 4.x).
  XCB using legacy driver "mouse": 27 buttons
  DirectFB: supports up to 27 buttons within Qt, but DirectFB issues 
appear to limit mouse support to 3 buttons.
  And finally, IIRC, a MouseArea can only supports 5 buttons.

** Why this might be useful **
(1) Mouse/Pointer Shortcuts with 2 or more buttons, containing more than 
ONE button with a "higher" enum value than "MiddleButton". (We already 
get a narrow mask containing 
Qt::LeftButton+Qt::RightButton+QtMiddleButton. But LeftButton might be 
used for gestures; RightButton pops up context menus, and MiddleButton 
is physically hard to push.)

(2) Various KDE and Qt Application might want to determine the State of 
all buttons at various times (in particular, at the time of the first 
MouseButton event following an XCB_ENTER_WINDOW event.)

** Why it just became possible **
   XCB Platform Plugin has been modified to use XI Version 2.x by 
default, instead of XI 1.x. XI V2.x provides a button mask of 32 bits. 
(Theoretically, multiple mask segments of 32 bits each. But we don't 
support those buttons, so we'll ignore any such "extra" bytes of mask 
bits.) Right now, in the platform plugin, we downgrade the XI 2.x 
pointer ButtonPress and ButtonRelease events, translating them into XI 
V1 events (losing information by doing that, obviously.) We SHOULD, IMO, 
break BC right now and include a 32-bit mask field for ButtonPress and 
ButtonRelease events on all platforms.

That field will never contain a set bit for a button higher than the 
supported maximum button number for the platform being used, but will 
otherwise include all buttons which remain in "IsPressed" State at the 
time of of the event (excluding the button which caused a 
MouseButtonRelease event to occur).




More information about the kde-core-devel mailing list