~ubuntu-branches/ubuntu/oneiric/gnome-settings-daemon/oneiric

« back to all changes in this revision

Viewing changes to plugins/common/gsd-input-helper.c

  • Committer: Package Import Robot
  • Author(s): Rodrigo Moya
  • Date: 2011-09-19 17:05:48 UTC
  • mto: This revision was merged to the branch mainline in revision 169.
  • Revision ID: package-import@ubuntu.com-20110919170548-4d8k2g7jrqp7rbe0
Tags: upstream-3.1.92
ImportĀ upstreamĀ versionĀ 3.1.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
 
239
239
        gdk_error_trap_push ();
240
240
 
241
 
        value = enabled;
 
241
        value = enabled ? 1 : 0;
242
242
        XIChangeProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
243
243
                          device_id, prop, XA_INTEGER, 8, PropModeReplace, &value, 1);
244
244
 
320
320
 
321
321
        return (exit_status == 0);
322
322
}
 
323
 
 
324
GList *
 
325
get_disabled_devices (GdkDeviceManager *manager)
 
326
{
 
327
        XDeviceInfo *device_info;
 
328
        gint n_devices;
 
329
        guint i;
 
330
        GList *ret;
 
331
 
 
332
        ret = NULL;
 
333
 
 
334
        device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &n_devices);
 
335
        if (device_info == NULL)
 
336
                return ret;
 
337
 
 
338
        for (i = 0; i < n_devices; i++) {
 
339
                GdkDevice *device;
 
340
 
 
341
                /* Ignore core devices */
 
342
                if (device_info[i].use == IsXKeyboard ||
 
343
                    device_info[i].use == IsXPointer)
 
344
                        continue;
 
345
 
 
346
                /* Check whether the device is actually available */
 
347
                device = gdk_x11_device_manager_lookup (manager, device_info[i].id);
 
348
                g_message ("checking whether we have a device for %d: %s", device_info[i].id, device ? "yes" : "no");
 
349
                if (device != NULL)
 
350
                        continue;
 
351
 
 
352
                ret = g_list_prepend (ret, GINT_TO_POINTER (device_info[i].id));
 
353
        }
 
354
 
 
355
        return ret;
 
356
}