[gnome-settings-daemon] common: Add trackball test
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Add trackball test
- Date: Thu, 11 Oct 2012 15:15:12 +0000 (UTC)
commit a2b3d26164ca1c90a1cd348a7e71b001b429df8a
Author: Bastien Nocera <hadess hadess net>
Date: Thu Oct 11 12:35:38 2012 +0200
common: Add trackball test
https://bugzilla.gnome.org/show_bug.cgi?id=685941
plugins/common/test-input-helper.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/plugins/common/test-input-helper.c b/plugins/common/test-input-helper.c
index 4a9cccf..1871dbb 100644
--- a/plugins/common/test-input-helper.c
+++ b/plugins/common/test-input-helper.c
@@ -54,7 +54,7 @@ print_disabled_devices (void)
int main (int argc, char **argv)
{
gboolean supports_xinput;
- gboolean has_touchpad, has_touchscreen;
+ gboolean has_touchpad, has_touchscreen, has_trackball;
XDeviceInfo *device_info;
gint n_devices, opcode;
guint i;
@@ -82,6 +82,9 @@ int main (int argc, char **argv)
has_touchscreen = touchscreen_is_present ();
g_print ("Has touchscreen:\t\t\t%s\n", has_touchscreen ? "yes" : "no");
+ has_trackball = trackball_is_present ();
+ g_print ("Has trackball:\t\t\t\t%s\n", has_trackball ? "yes" : "no");
+
device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &n_devices);
if (device_info == NULL) {
g_warning ("Has no input devices");
@@ -97,6 +100,10 @@ int main (int argc, char **argv)
g_print ("Device %d is touchscreen:\t\t%s\n", (int) device_info[i].id, "yes");
continue;
}
+ if (device_info_is_trackball (&device_info[i])) {
+ g_print ("Device %d is trackball:\t\t\t%s\n", (int) device_info[i].id, "yes");
+ continue;
+ }
gdk_error_trap_push ();
device = XOpenDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device_info[i].id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]