summaryrefslogtreecommitdiff
path: root/libupower-glib/up-device.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-10-24 12:50:26 +0200
committerBastien Nocera <hadess@hadess.net>2019-10-24 12:50:26 +0200
commit72b85b8c1371f3396c293d9a2aa373b6a7551f63 (patch)
treeb6e1d6ec884f3877ec59dd6c0c480b1a6a3c7417 /libupower-glib/up-device.c
parenta1a437d7b1e0a9ea46bf72c390c3aeaf6d61c07d (diff)
lib: Add "Pen" device type
So we can track the battery information for powered tablet pens, rather than labelling them as tablets.
Diffstat (limited to 'libupower-glib/up-device.c')
-rw-r--r--libupower-glib/up-device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c
index e21274d..01f752f 100644
--- a/libupower-glib/up-device.c
+++ b/libupower-glib/up-device.c
@@ -313,7 +313,8 @@ up_device_to_text (UpDevice *device)
kind == UP_DEVICE_KIND_BATTERY ||
kind == UP_DEVICE_KIND_MOUSE ||
kind == UP_DEVICE_KIND_KEYBOARD ||
- kind == UP_DEVICE_KIND_GAMING_INPUT) &&
+ kind == UP_DEVICE_KIND_GAMING_INPUT ||
+ kind == UP_DEVICE_KIND_PEN) &&
!is_display)
g_string_append_printf (string, " rechargeable: %s\n", up_device_bool_to_string (up_exported_device_get_is_rechargeable (priv->proxy_device)));
if (kind == UP_DEVICE_KIND_BATTERY ||
@@ -367,7 +368,8 @@ up_device_to_text (UpDevice *device)
kind == UP_DEVICE_KIND_COMPUTER ||
kind == UP_DEVICE_KIND_MEDIA_PLAYER ||
kind == UP_DEVICE_KIND_UPS ||
- kind == UP_DEVICE_KIND_GAMING_INPUT) {
+ kind == UP_DEVICE_KIND_GAMING_INPUT ||
+ kind == UP_DEVICE_KIND_PEN) {
if (battery_level == UP_DEVICE_LEVEL_NONE)
g_string_append_printf (string, " percentage: %g%%\n", up_exported_device_get_percentage (priv->proxy_device));
else