Add :is-default flag to InputDevice

This commit is contained in:
Emmanuele Bassi 2009-11-20 15:43:50 +00:00
parent 3027d4327a
commit ca16446319
2 changed files with 10 additions and 1 deletions

View File

@ -97,6 +97,8 @@ struct _ClutterInputDevice
gint previous_y; gint previous_y;
guint32 previous_time; guint32 previous_time;
gint previous_button_number; gint previous_button_number;
guint is_default : 1;
}; };
struct _ClutterStageManager struct _ClutterStageManager

View File

@ -252,7 +252,12 @@ clutter_x11_register_input_devices (ClutterBackendX11 *backend)
} }
if (info->use == IsXExtensionPointer && num_events > 0) if (info->use == IsXExtensionPointer && num_events > 0)
{
/* mark it as a default */
device->device.is_default = TRUE;
have_an_xpointer = TRUE; have_an_xpointer = TRUE;
}
device->num_events = n_events; device->num_events = n_events;
@ -313,11 +318,13 @@ default_device:
d->previous_x = -1; d->previous_x = -1;
d->previous_y = -1; d->previous_y = -1;
d->previous_button_number = -1; d->previous_button_number = -1;
d->is_default = TRUE;
_clutter_device_manager_add_device (manager, d); _clutter_device_manager_add_device (manager, d);
d = g_slice_new0 (ClutterInputDevice); d = g_slice_new0 (ClutterInputDevice);
d->id = 1; d->id = 1;
d->device_type = CLUTTER_KEYBOARD_DEVICE; d->device_type = CLUTTER_KEYBOARD_DEVICE;
d->is_default = TRUE;
_clutter_device_manager_add_device (manager, d); _clutter_device_manager_add_device (manager, d);
} }
} }