mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
virtual-image: Use explicit list of cases in which we want to listen
Depending on the enum order is ok, but not really maintainable so better to explicitly list the states we want to listen.
This commit is contained in:
@@ -188,11 +188,18 @@ on_listener_connected (FpDeviceVirtualListener *listener,
|
||||
g_object_get (self,
|
||||
"fpi-image-device-state", &state,
|
||||
NULL);
|
||||
/* Only read if we are in AWAIT_FINGER_* or CAPTURE states */
|
||||
if (state <= FPI_IMAGE_DEVICE_STATE_DEACTIVATING)
|
||||
return;
|
||||
|
||||
recv_image (self);
|
||||
switch (state)
|
||||
{
|
||||
case FPI_IMAGE_DEVICE_STATE_IDLE:
|
||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON:
|
||||
case FPI_IMAGE_DEVICE_STATE_CAPTURE:
|
||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF:
|
||||
recv_image (self);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user