[gnome-control-center/wip/carlosg/pick-default-pen] wacom: Pick libwacom's Generic Pen stylus if tool ID is 0



commit 520411840b6cd1b9b72e4a2fd19701aad7145f4f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Feb 13 20:28:29 2020 +0100

    wacom: Pick libwacom's Generic Pen stylus if tool ID is 0
    
    We generally use tool ID 0 if the ID is actually unknown, libwacom however
    assigns 0xfffff to such device. Make it sure we find the "Generic Pen"
    stylus description in that case.

 panels/wacom/cc-wacom-tool.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/panels/wacom/cc-wacom-tool.c b/panels/wacom/cc-wacom-tool.c
index 1316fa5d6..d54de6160 100644
--- a/panels/wacom/cc-wacom-tool.c
+++ b/panels/wacom/cc-wacom-tool.c
@@ -165,7 +165,10 @@ cc_wacom_tool_initable_init (GInitable     *initable,
                        tool->id = ids[0];
        }
 
-       tool->wstylus = libwacom_stylus_get_for_id (wacom_db, tool->id);
+       if (tool->id == 0)
+               tool->wstylus = libwacom_stylus_get_for_id (wacom_db, 0xfffff);
+       else
+               tool->wstylus = libwacom_stylus_get_for_id (wacom_db, tool->id);
 
        if (!tool->wstylus) {
                g_set_error (error, 0, 0, "Stylus description not found");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]