ui/cocoa: Fix mouse association state
commitd1929069e355afb809a50a7f6b6affdea399cc8c
authorAkihiko Odaki <akihiko.odaki@gmail.com>
Mon, 22 Feb 2021 15:07:14 +0000 (23 00:07 +0900)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 11 Mar 2021 12:33:20 +0000 (11 13:33 +0100)
tree25ad7521bc1b94abe619e26d44474b48cec681a2
parentcb82340825eed168f732511926477f5f124010be
ui/cocoa: Fix mouse association state

ui/cocoa deassociates the mouse input and the mouse cursor
position only when relative movement inputs are expected. Such
inputs may let the mouse cursor leave the view and cause undesired
side effects if they are associated. On the other hand, the
problem does not occur when inputting absolute points, and the
association allows seamless cursor movement across views.

However, the synchronization of the association and the expected
input type was only done when grabbing the mouse. In reality, the
state whether the emulated input device expects absolute pointing
inputs or relative movement inputs can vary dynamically due to
USB device hot-plugging, for example.

This change adds association state updates according to input type
expectation changes. It also removes an internal flag representing
the association state because the state can now be determined with
the current input type expectation and it only adds the
complexity of the state tracking.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <20210222150714.21766-1-akihiko.odaki@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/cocoa.m