[gnome-settings-daemon] common: Show accelerometer in test output
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Show accelerometer in test output
- Date: Wed, 1 Jun 2011 15:53:29 +0000 (UTC)
commit f4c5d2da44a240624857bf3af74fc3e6dd4b46b7
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jun 1 16:15:44 2011 +0100
common: Show accelerometer in test output
If one is present.
plugins/common/test-input-helper.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/plugins/common/test-input-helper.c b/plugins/common/test-input-helper.c
index 400259a..28b40d6 100644
--- a/plugins/common/test-input-helper.c
+++ b/plugins/common/test-input-helper.c
@@ -34,9 +34,10 @@ int main (int argc, char **argv)
gboolean supports_xinput;
gboolean has_touchpad, has_touchscreen;
XDeviceInfo *device_info;
+ char *dev_node;
+ int devid;
gint n_devices;
guint i;
- gboolean retval;
gtk_init (&argc, &argv);
@@ -47,6 +48,13 @@ int main (int argc, char **argv)
g_print ("Supports XInput:\t\t\tno\n");
return 0;
}
+ supports_xinput = supports_xinput2_devices ();
+ if (supports_xinput) {
+ g_print ("Supports XInput2:\t\t\tyes\n");
+ } else {
+ g_print ("Supports XInput2:\t\t\tno\n");
+ return 0;
+ }
has_touchpad = touchpad_is_present ();
g_print ("Has touchpad:\t\t\t\t%s\n", has_touchpad ? "yes" : "no");
@@ -54,6 +62,13 @@ int main (int argc, char **argv)
has_touchscreen = touchscreen_is_present ();
g_print ("Has touchscreen:\t\t\t%s\n", has_touchscreen ? "yes" : "no");
+ if (accelerometer_is_present (&dev_node, &devid)) {
+ g_print ("Has accelerometer:\t\t\t%s (%d)\n", dev_node, devid);
+ g_free (dev_node);
+ } else {
+ g_print ("Has accelerometer:\t\t\t%s\n", "no");
+ }
+
device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &n_devices);
if (device_info == NULL) {
g_warning ("Has no input devices");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]