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 672691 - Hide/show mapping buttons depending on the presence of a PAD on the device
Hide/show mapping buttons depending on the presence of a PAD on the device
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Wacom
3.3.x
Other Linux
: Normal enhancement
: ---
Assigned To: Peter Hutterer
Control-Center Maintainers
: 676791 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-23 13:51 UTC by Olivier Fourdan
Modified: 2012-05-25 10:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch 1/3 (5.24 KB, patch)
2012-03-23 13:52 UTC, Olivier Fourdan
accepted-commit_now Details | Review
Patch 2/3 (3.22 KB, patch)
2012-03-23 13:53 UTC, Olivier Fourdan
accepted-commit_now Details | Review
Patch 3/3 (2.63 KB, patch)
2012-03-23 13:53 UTC, Olivier Fourdan
reviewed Details | Review
Updated (consolidated) patch (6.78 KB, patch)
2012-04-11 09:02 UTC, Olivier Fourdan
none Details | Review
Updated (consolidated) patch (6.78 KB, patch)
2012-04-11 09:10 UTC, Olivier Fourdan
needs-work Details | Review
Updated (consolidated) patch (6.95 KB, patch)
2012-04-12 13:37 UTC, Olivier Fourdan
committed Details | Review

Description Olivier Fourdan 2012-03-23 13:51:00 UTC
The attached patches hide the "map button" from the UI when no pad is present on the device.

It's slightly more complex than just hiding the button because of a race condition between the wacom driver and he the UI.

The device_added_cb is called once for each tool added. The wacom driver hotplugs tools in the order stylus, eraser, cursor, pad.

update_current_page will add a new page once a tablet has stylus and eraser, before cursor and pad exist. priv->pad is thus always NULL, causing, cc_wacom_page's update_tablet_ui to remove the "Map Buttons..." button for any device.

Change the code to update the tool list for every new tool we get, merely triggering the visibility of the button instead of destroying it completely.

Also, in the case of a screen tablet, the calbrator cannot run if a matching is not made with a Wacom monitor, this patches also make the "calibrate" button insensitive when calibration cannot be run (better that keeping a button without any effect).
Comment 1 Olivier Fourdan 2012-03-23 13:52:46 UTC
Created attachment 210426 [details] [review]
Patch 1/3
Comment 2 Olivier Fourdan 2012-03-23 13:53:14 UTC
Created attachment 210427 [details] [review]
Patch 2/3
Comment 3 Olivier Fourdan 2012-03-23 13:53:37 UTC
Created attachment 210428 [details] [review]
Patch 3/3
Comment 4 Bastien Nocera 2012-03-26 08:56:01 UTC
Review of attachment 210426 [details] [review]:

Looks good. Remove the Signed-Off-By lines though.
Comment 5 Bastien Nocera 2012-03-26 08:57:26 UTC
Review of attachment 210427 [details] [review]:

Please merge the patch into Peter's.

::: panels/wacom/cc-wacom-panel.c
@@ -226,3 @@
 			g_hash_table_insert (priv->pages, g_strdup (tablet->name), page);
 			changed = TRUE;
 		} else

If one condition branch has braces, please use them in both branches.
Comment 6 Bastien Nocera 2012-03-26 09:01:50 UTC
Review of attachment 210428 [details] [review]:

Is this a clean up patch? Looks like a bug fix for a previous patch, and an undocumented functional change.

::: panels/wacom/cc-wacom-page.c
@@ +1056,2 @@
 		gtk_widget_show (WID ("button-calibrate"));
+		if (gsd_wacom_device_get_display_monitor (page->priv->stylus) < 0)

This looks unrelated to the rest of the patch.
Comment 7 Olivier Fourdan 2012-03-26 09:18:48 UTC
(In reply to comment #6)
> Review of attachment 210428 [details] [review]:
> 
> Is this a clean up patch? Looks like a bug fix for a previous patch, and an
> undocumented functional change.

All 3 patches are dependant, it's separate commits that occurred at different point in time (git format-patch output).

If more appropriate I could provide a simpler git diff but we'd be loosing history and git commit.
 
> ::: panels/wacom/cc-wacom-page.c
> @@ +1056,2 @@
>          gtk_widget_show (WID ("button-calibrate"));
> +        if (gsd_wacom_device_get_display_monitor (page->priv->stylus) < 0)
> 
> This looks unrelated to the rest of the patch.

Unrelated but not undocumented, that's the "this patches also make the "calibrate" button insensitive when calibration cannot be run" part in comment #0
Comment 8 Bastien Nocera 2012-03-26 15:16:24 UTC
I'd rather a single commit with "With help from..." than 3 separate commits, 2 of which are bug fixes to the original commit.
Comment 9 Olivier Fourdan 2012-03-26 15:21:10 UTC
(In reply to comment #8)
> I'd rather a single commit with "With help from..." than 3 separate commits, 2
> of which are bug fixes to the original commit.

OK I'll prepare a new patch. 

While I'm at it Do you want to keep the "make the calibrate button insensitive when calibration cannot be run" part or would you prefer a separate bug for that?
Comment 10 Bastien Nocera 2012-03-26 15:24:41 UTC
If you can separate out the commits, I'd rather they be separate (as they're functionally separate). Thanks.
Comment 11 Olivier Fourdan 2012-04-11 09:02:24 UTC
Created attachment 211813 [details] [review]
Updated (consolidated) patch

(In reply to comment #10)
> If you can separate out the commits, I'd rather they be separate (as they're
> functionally separate). Thanks.

Consolidated patch (without the calibrate fix which will be sent in a separate bugzilla)
Comment 12 Olivier Fourdan 2012-04-11 09:10:26 UTC
Created attachment 211815 [details] [review]
Updated (consolidated) patch

Same with curly braces as per comment 5
Comment 13 Bastien Nocera 2012-04-12 10:02:12 UTC
Review of attachment 211815 [details] [review]:

Can you create your patch with "git format-patch -1" rather than "git show" please? It won't apply with "git am" otherwise.
Comment 14 Olivier Fourdan 2012-04-12 13:37:37 UTC
Created attachment 211927 [details] [review]
Updated (consolidated) patch

(In reply to comment #13)
> Can you create your patch with "git format-patch -1" rather than "git show"
> please? It won't apply with "git am" otherwise.

Sure, here it comes :)
Comment 15 Bastien Nocera 2012-05-25 10:53:09 UTC
*** Bug 676791 has been marked as a duplicate of this bug. ***