+ if (type == GDK_BUTTON_PRESS &&
+ pointer_info->need_touch_press_enter)
+ {
+ GdkCrossingMode mode;
+
+ /* The last device to interact with the window was a touch device,
+ * which synthesized a leave notify event, so synthesize another enter
+ * notify to tell the pointer is on the window.
+ */
+ if (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD)
+ mode = GDK_CROSSING_TOUCH_BEGIN;
+ else
+ mode = GDK_CROSSING_DEVICE_SWITCH;
+
+ pointer_info->need_touch_press_enter = FALSE;
+ _gdk_synthesize_crossing_events (display,
+ NULL,
+ pointer_info->window_under_pointer,
+ device, source_device, mode,
+ toplevel_x, toplevel_y,
+ state, time_, source_event,
+ serial, FALSE);
+ }
+