From b7e27bfdc6fdd2806659b350b91320b035f6e474 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Wed, 17 Jun 2020 14:16:34 +0200
Subject: [PATCH] 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
---
 demo/gtk-libfprint-test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/demo/gtk-libfprint-test.c b/demo/gtk-libfprint-test.c
index 8026815..9ef8768 100644
--- a/demo/gtk-libfprint-test.c
+++ b/demo/gtk-libfprint-test.c
@@ -241,6 +241,8 @@ dev_capture_start_cb (FpDevice     *dev,
       if (error->domain == FP_DEVICE_RETRY ||
           g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
         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
         libfprint_demo_set_mode (win, ERROR_MODE);
       return;