mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
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:
parent
921c154e38
commit
358d15ae5e
@ -7697,6 +7697,7 @@ is_button_type (GdkEventType type)
|
|||||||
type == GDK_BUTTON_RELEASE ||
|
type == GDK_BUTTON_RELEASE ||
|
||||||
type == GDK_TOUCH_BEGIN ||
|
type == GDK_TOUCH_BEGIN ||
|
||||||
type == GDK_TOUCH_END ||
|
type == GDK_TOUCH_END ||
|
||||||
|
type == GDK_TOUCH_CANCEL ||
|
||||||
type == GDK_SCROLL;
|
type == GDK_SCROLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9322,6 +9323,7 @@ proxy_button_event (GdkEvent *source_event,
|
|||||||
|
|
||||||
case GDK_TOUCH_BEGIN:
|
case GDK_TOUCH_BEGIN:
|
||||||
case GDK_TOUCH_END:
|
case GDK_TOUCH_END:
|
||||||
|
case GDK_TOUCH_CANCEL:
|
||||||
convert_toplevel_coords_to_window (event_win,
|
convert_toplevel_coords_to_window (event_win,
|
||||||
toplevel_x, toplevel_y,
|
toplevel_x, toplevel_y,
|
||||||
&event->button.x, &event->button.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);
|
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)) &&
|
_gdk_event_get_pointer_emulated (source_event)) &&
|
||||||
pointer_window == pointer_info->window_under_pointer &&
|
pointer_window == pointer_info->window_under_pointer &&
|
||||||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
|
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
|
||||||
|
Loading…
Reference in New Issue
Block a user