diff --git a/clutter/clutter/clutter-seat.c b/clutter/clutter/clutter-seat.c index 13a862bf4..96bb0e930 100644 --- a/clutter/clutter/clutter-seat.c +++ b/clutter/clutter/clutter-seat.c @@ -749,3 +749,30 @@ clutter_seat_get_touch_mode (ClutterSeat *seat) return touch_mode; } + +/** + * clutter_seat_has_touchscreen: (skip) + **/ +gboolean +clutter_seat_has_touchscreen (ClutterSeat *seat) +{ + gboolean has_touchscreen; + const GList *devices, *l; + + g_return_val_if_fail (CLUTTER_IS_SEAT (seat), FALSE); + + devices = clutter_seat_peek_devices (seat); + for (l = devices; l; l = l->next) + { + ClutterInputDevice *device = l->data; + + if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL && + clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE) + { + has_touchscreen = TRUE; + break; + } + } + + return has_touchscreen; +} diff --git a/clutter/clutter/clutter-seat.h b/clutter/clutter/clutter-seat.h index aa88d7300..33497a43f 100644 --- a/clutter/clutter/clutter-seat.h +++ b/clutter/clutter/clutter-seat.h @@ -194,4 +194,7 @@ void clutter_seat_warp_pointer (ClutterSeat *seat, CLUTTER_EXPORT gboolean clutter_seat_get_touch_mode (ClutterSeat *seat); +CLUTTER_EXPORT +gboolean clutter_seat_has_touchscreen (ClutterSeat *seat); + #endif /* CLUTTER_SEAT_H */