gtk: Fix the relative pointer tracking mode
commite61031cdd81826c433a8bbfa3aca2bae4ffaf845
authorTakashi Iwai <tiwai@suse.de>
Fri, 4 Apr 2014 10:41:22 +0000 (4 12:41 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 7 Apr 2014 08:10:10 +0000 (7 10:10 +0200)
tree6576a4860058a4f8557ed8a4cb96e95bc62337de
parent0d0e044dee0ed59628bb093a5be03528d6bde445
gtk: Fix the relative pointer tracking mode

The relative pointer tracking mode was still buggy even after the
previous fix of the motion-notify-event since the events are filtered
out when the pointer moves outside the drawing window due to the
boundary check for the absolute mode.

This patch fixes the issue by moving the unnecessary boundary check
into the if block of absolute mode, and keep the coordinate in the
relative mode even if it's outside the drawing area.  But this makes
the coordinate (last_x, last_y) possibly pointing to (-1,-1),
introduce a new flag to indicate the last coordinate has been
updated.

Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
Tested-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Tested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/gtk.c