xrt: Make it possible for the device set active status on inputs

This commit is contained in:
Jakob Bornecrantz 2019-12-25 14:16:40 +00:00
parent 998b198b44
commit 7082a599c7
2 changed files with 8 additions and 0 deletions

View file

@ -251,6 +251,11 @@ u_device_allocate(enum u_device_alloc_flags flags,
if (num_inputs > 0) {
xdev->num_inputs = num_inputs;
xdev->inputs = (struct xrt_input *)(ptr + offset_inputs);
// Set inputs to active initially, easier for drivers.
for (size_t i = 0; i < num_inputs; i++) {
xdev->inputs[i].active = true;
}
}
if (num_outputs > 0) {

View file

@ -180,6 +180,9 @@ struct xrt_hmd_parts
*/
struct xrt_input
{
//! Is this input active.
bool active;
int64_t timestamp;
enum xrt_input_name name;