• Laszlo Agocs's avatar
    xcb: Use XIGrabDevice instead of xcb_grab_pointer with XI 2.2 · 53d289ec
    Laszlo Agocs authored
    Switch to using the pointer events from XI2 when touch is available (i.e.
    version is >= 2.2). This allows us to select and grab the button and motion
    events together with the touch ones. This prevents the issue of not getting
    touch events when grabbing via the plain xcb functions.
    
    To prevent touch sequences from being replayed after ungrabbing (for example after
    dismissing a popup that caused a grab), we try to accept touches via XIAllowTouchEvents.
    Unfortunately this leads to a deadlock and therefore we can only do it when we know
    we have a new enough libXi. This is a configure time check which is not ideal since
    the system on which apps run can have a newer libXi than the machine that did the Qt
    build, but seems like the best we can do.
    
    The environment variable QT_XCB_NO_XI2_MOUSE can be set to 1 in order to prevent
    processing mouse events through XInput. This restores the old behavior with broken
    grabbing.
    
    [ChangeLog][QtGui] Pointer event...
    53d289ec