Ticket #4068: 0001-gdk-rely-on-XIDeviceChangedEvent-to-update-touch-cro.patch

File 0001-gdk-rely-on-XIDeviceChangedEvent-to-update-touch-cro.patch, 2.6 KB (added by garnacho, 11 years ago)

GTK+ patch

  • gdk/gdkdisplay.c

    From 2be36c5b26c8e4ad954fb28a7dc799ba75185f6f Mon Sep 17 00:00:00 2001
    From: Carlos Garnacho <carlos@lanedo.com>
    Date: Thu, 29 Nov 2012 14:45:35 +0100
    Subject: [PATCH] gdk: rely on XIDeviceChangedEvent to update touch crossing
     events
    
    This signal is emitted to all clients regardless of the pointer position,
    so GDK can prepare to block/synthesize crossing events for touch devices
    devices prior to getting the pointer on top.
    
    This helps in those crossing events with sourceid=deviceid (eg both
    master) that Xorg generates on non-device generated crossing events,
    such as windows underneath the pointer moving or disappearing.
    ---
     gdk/gdkdisplay.c               | 12 ++++++++++++
     gdk/gdkdisplayprivate.h        |  4 ++++
     gdk/x11/gdkdevicemanager-xi2.c |  3 +++
     3 files changed, 19 insertions(+)
    
    diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
    index 60bbb44..3c6c810 100644
    a b _gdk_display_pointer_info_foreach (GdkDisplay *display, 
    12641264    }
    12651265}
    12661266
     1267void
     1268_gdk_display_update_touch_state (GdkDisplay *display,
     1269                                 GdkDevice  *device,
     1270                                 GdkDevice  *source)
     1271{
     1272  GdkPointerWindowInfo *info;
     1273
     1274  info = _gdk_display_get_pointer_info (display, device);
     1275  info->need_touch_press_enter =
     1276    (gdk_device_get_source (source) == GDK_SOURCE_TOUCHSCREEN);
     1277}
     1278
    12671279/**
    12681280 * gdk_device_grab_info_libgtk_only:
    12691281 * @display: the display for which to get the grab information
  • gdk/gdkdisplayprivate.h

    diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
    index 6549f21..3d078d6 100644
    a b void _gdk_display_create_window_impl (GdkDisplay *display 
    310310                                                       gint              attributes_mask);
    311311GdkWindow *         _gdk_display_create_window        (GdkDisplay       *display);
    312312
     313void                _gdk_display_update_touch_state   (GdkDisplay       *display,
     314                                                       GdkDevice        *device,
     315                                                       GdkDevice        *source);
     316
    313317G_END_DECLS
    314318
    315319#endif  /* __GDK_DISPLAY_PRIVATE_H__ */
  • gdk/x11/gdkdevicemanager-xi2.c

    diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
    index cfbfe6f..dbcb551 100644
    a b handle_device_changed (GdkX11DeviceManagerXI2 *device_manager, 
    774774
    775775  if (source_device)
    776776    _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
     777
     778  if (device && source_device)
     779    _gdk_display_update_touch_state (display, device, source_device);
    777780}
    778781
    779782static GdkCrossingMode