demo: Handle the non-imaging mode also if we get a non-supported error

Image devices may return a FP_DEVICE_ERROR_NOT_SUPPORTED error once capture
is already started, in such case handle the error going in non imaging mode
This commit is contained in:
Marco Trevisan (Treviño) 2020-06-17 14:16:34 +02:00
parent 37b19674f1
commit b7e27bfdc6

View file

@ -241,6 +241,8 @@ dev_capture_start_cb (FpDevice *dev,
if (error->domain == FP_DEVICE_RETRY || if (error->domain == FP_DEVICE_RETRY ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
libfprint_demo_set_mode (win, RETRY_MODE); libfprint_demo_set_mode (win, RETRY_MODE);
else if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_NOT_SUPPORTED))
libfprint_demo_set_mode (win, NOIMAGING_MODE);
else else
libfprint_demo_set_mode (win, ERROR_MODE); libfprint_demo_set_mode (win, ERROR_MODE);
return; return;