gdk: Make GDK_TOUCH_CANCEL be dealt with similarly to GDK_TOUCH_END

We must emit the cancel event with the same semantics, and towards the GdkWindow
that is currently under the touchpoint, so make proxy_button_event() deal with
GDK_TOUCH_CANCEL.

Fixes the GDK_TOUCH_CANCEL event being emitted only on the toplevel, which is
usually non-sufficient.
This commit is contained in:
Carlos Garnacho 2016-04-17 21:19:58 +01:00
parent 921c154e38
commit 358d15ae5e

View File

@ -7697,6 +7697,7 @@ is_button_type (GdkEventType type)
type == GDK_BUTTON_RELEASE ||
type == GDK_TOUCH_BEGIN ||
type == GDK_TOUCH_END ||
type == GDK_TOUCH_CANCEL ||
type == GDK_SCROLL;
}
@ -9322,6 +9323,7 @@ proxy_button_event (GdkEvent *source_event,
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
convert_toplevel_coords_to_window (event_win,
toplevel_x, toplevel_y,
&event->button.x, &event->button.y);
@ -9337,7 +9339,7 @@ proxy_button_event (GdkEvent *source_event,
gdk_event_set_source_device (event, source_device);
if ((type == GDK_TOUCH_END &&
if (((type == GDK_TOUCH_END || type == GDK_TOUCH_CANCEL) &&
_gdk_event_get_pointer_emulated (source_event)) &&
pointer_window == pointer_info->window_under_pointer &&
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)