From d115c90ed18042c50e2228eeac4b1079dd386822 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 2 Sep 2011 21:13:54 +0200 Subject: [PATCH] device-map: Add grab/ungrab_touch() methods These functions deal with passive touch grabs, where available --- src/core/device-map-private.h | 9 +++++++++ src/core/device-map.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/core/device-map-private.h b/src/core/device-map-private.h index 00a2fcbf8..11a625334 100644 --- a/src/core/device-map-private.h +++ b/src/core/device-map-private.h @@ -76,6 +76,10 @@ struct _MetaDeviceMapClass Window xwindow, guint n_button, guint modifiers); + void (* grab_touch) (MetaDeviceMap *pointer, + Window xwindow); + void (* ungrab_touch) (MetaDeviceMap *pointer, + Window xwindow); }; GType meta_device_map_get_type (void) G_GNUC_CONST; @@ -108,4 +112,9 @@ void meta_device_map_ungrab_button (MetaDeviceMap *device_map, guint n_button, guint modifiers); +void meta_device_map_grab_touch (MetaDeviceMap *device_map, + Window xwindow); +void meta_device_map_ungrab_touch (MetaDeviceMap *device_map, + Window xwindow); + #endif /* META_DEVICE_MAP_PRIVATE_H */ diff --git a/src/core/device-map.c b/src/core/device-map.c index 33af95a55..c8627edda 100644 --- a/src/core/device-map.c +++ b/src/core/device-map.c @@ -397,3 +397,33 @@ meta_device_map_ungrab_button (MetaDeviceMap *device_map, if (klass->ungrab_button) (klass->ungrab_button) (device_map, xwindow, n_button, modifiers); } + +void +meta_device_map_grab_touch (MetaDeviceMap *device_map, + Window xwindow) +{ + MetaDeviceMapClass *klass; + + g_return_if_fail (META_IS_DEVICE_MAP (device_map)); + g_return_if_fail (xwindow != None); + + klass = META_DEVICE_MAP_GET_CLASS (device_map); + + if (klass->grab_touch) + (klass->grab_touch) (device_map, xwindow); +} + +void +meta_device_map_ungrab_touch (MetaDeviceMap *device_map, + Window xwindow) +{ + MetaDeviceMapClass *klass; + + g_return_if_fail (META_IS_DEVICE_MAP (device_map)); + g_return_if_fail (xwindow != None); + + klass = META_DEVICE_MAP_GET_CLASS (device_map); + + if (klass->ungrab_touch) + (klass->ungrab_touch) (device_map, xwindow); +}