[x11] Hold a passive grab on buttons only when needed
Due to a bug in the XI2 protocol, clients have to reset scroll valuators on XI_Enter because the scroll valuators might have changed while the pointer was elsewhere. The XI_Enter event is usually sent when an input device enters the window, but it can also be generated by a passive grab.
If an XI_Enter event has been generated by a passive grab, the client should not reset scroll valuators. Unfortunately, there is no any reliable way for the client to determine if an XI_Enter event has been sent in response to a deactivated passive grab. A correct fix for the scroll issues in GTK apps would involve changes in the XI2 protocol.
As a work around, we can hold a passive grab only if the current mouse wheel action is either "Activate and scroll" or "Activate, raise, and scroll."
BUG: 394772 FIXED-IN: 5.19.3