device-map: Add grab/ungrab_touch() methods

These functions deal with passive touch grabs, where
available
This commit is contained in:
Carlos Garnacho 2011-09-02 21:13:54 +02:00
parent 83096642f0
commit d115c90ed1
2 changed files with 39 additions and 0 deletions

View File

@ -76,6 +76,10 @@ struct _MetaDeviceMapClass
Window xwindow, Window xwindow,
guint n_button, guint n_button,
guint modifiers); 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; 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 n_button,
guint modifiers); 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 */ #endif /* META_DEVICE_MAP_PRIVATE_H */

View File

@ -397,3 +397,33 @@ meta_device_map_ungrab_button (MetaDeviceMap *device_map,
if (klass->ungrab_button) if (klass->ungrab_button)
(klass->ungrab_button) (device_map, xwindow, n_button, modifiers); (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);
}