After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 677562 - wacom: need to flag unknown devices
wacom: need to flag unknown devices
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-06-06 16:02 UTC by Olivier Fourdan
Modified: 2012-06-11 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (5.85 KB, patch)
2012-06-06 16:12 UTC, Olivier Fourdan
reviewed Details | Review
Updated patch (4.70 KB, patch)
2012-06-08 12:08 UTC, Olivier Fourdan
none Details | Review
Updated patch (4.71 KB, patch)
2012-06-08 12:12 UTC, Olivier Fourdan
needs-work Details | Review
Updated patch (3.35 KB, patch)
2012-06-08 13:00 UTC, Olivier Fourdan
none Details | Review
Updated patch (3.00 KB, patch)
2012-06-08 13:02 UTC, Olivier Fourdan
accepted-commit_now Details | Review

Description Olivier Fourdan 2012-06-06 16:02:53 UTC
so we can report that in the gnome-control-center Wacom panel (bug 668611)
Comment 1 Olivier Fourdan 2012-06-06 16:12:41 UTC
Created attachment 215754 [details] [review]
Proposed patch

Adds a "is_fallback" flag for device and stylus, and methods to read that flag.

Also adds a new setting to allow users to disable notification (per device)
Comment 2 Bastien Nocera 2012-06-06 16:16:37 UTC
Review of attachment 215754 [details] [review]:

::: data/org.gnome.settings-daemon.peripherals.wacom.gschema.xml.in.in
@@ +19,3 @@
+      <default>true</default>
+      <_summary>Warn about unknown device</_summary>
+      <_description>Enable this to warn the user when an unknown (fallback) device is created.</_description>

Really rather not. The UI could use an info bar or something instead.
Comment 3 Olivier Fourdan 2012-06-08 08:55:40 UTC
Sorry I do not understand.

Once a fallback device has been detected, and the user do not want to see that warning again for the same device, we need to flag it in the settings database, that's the purpose of that settings.

I don't see what an info bar has to do with that.
Comment 4 Olivier Fourdan 2012-06-08 08:57:25 UTC
Just to be clear, the purpose of that settings is to implement https://bugzilla.gnome.org/show_bug.cgi?id=668611#c0
Comment 5 Bastien Nocera 2012-06-08 09:53:47 UTC
(In reply to comment #3)
> Sorry I do not understand.
> 
> Once a fallback device has been detected, and the user do not want to see that
> warning again for the same device,

Maybe. Maybe not. The bug you're referencing hasn't exactly been through design.

> we need to flag it in the settings database,
> that's the purpose of that settings.

This setting has nothing to do with gnome-settings-daemon's configuration storage, because it's not configuration. If anything needs to be stored for gnome-control-center to use, then it should save that on its own (in a side keyfile in XDG_CONFIG_DIR or something).

> I don't see what an info bar has to do with that.

We could always show the infobar instead of having warning popups. But as mentioned earlier, this needs to go through design. We might also need to add support for loading tablet definitions from the user's local directory, etc.

The rest of the patch is fine, please upload a new one here, and I'll mark it as commit now.
Comment 6 Olivier Fourdan 2012-06-08 12:08:38 UTC
Created attachment 215943 [details] [review]
Updated patch

Updated patch without the new GSetting as per comment #2
Comment 7 Olivier Fourdan 2012-06-08 12:12:56 UTC
Created attachment 215945 [details] [review]
Updated patch

(same as comment #6 with consistent g_return_val_if_fail() when the passed param in not of expected type)
Comment 8 Bastien Nocera 2012-06-08 12:45:25 UTC
Review of attachment 215945 [details] [review]:

Sorry to come back to you with this, but I'm not sure we want to separate "is_fallback" for styli and tablets.

The "/* Create a fallback stylus if we don't have one */" branch is impossible to get to, with a recent libwacom, as we will add styli ourselves if "Styli=" isn't present.
Furthermore, the absence of "Styli=" definition in a tablet file isn't a bug, it's the way we define devices that don't have styli with device ids.

I think you should restrict the GsdWacomDevice to have a "fallback" property.

::: plugins/wacom/gsd-wacom-device.c
@@ +1212,3 @@
 		db = libwacom_database_new ();
 
+	device->priv->is_fallback = FALSE; /* Until proven otherwise */

The private struct is zero'ed when instantiated, so there's no need to set it, unless you absolutely want this comment to appear (I don't think it's useful).
Comment 9 Olivier Fourdan 2012-06-08 13:00:12 UTC
Created attachment 215948 [details] [review]
Updated patch

(In reply to comment #8)

Sure, agreed. This one also adds the info to the list-wacom test program.
Comment 10 Olivier Fourdan 2012-06-08 13:02:20 UTC
Created attachment 215949 [details] [review]
Updated patch

Same, but without removing a blank line to remain as the original file.
Comment 11 Bastien Nocera 2012-06-08 14:07:52 UTC
Review of attachment 215949 [details] [review]:

Looks good.
Comment 12 Olivier Fourdan 2012-06-11 13:12:43 UTC
committed