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 657423 - Calibrate button doesn't do anything
Calibrate button doesn't do anything
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Wacom
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Peter Hutterer
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-26 10:41 UTC by Bastien Nocera
Modified: 2012-01-18 23:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch 1/3 - Megapatch (45.04 KB, patch)
2012-01-10 18:11 UTC, Jason Gerecke
committed Details | Review
Patch 2/3 - Wire up calibrate button to calibration utility (8.06 KB, patch)
2012-01-10 18:12 UTC, Jason Gerecke
committed Details | Review
Patch 3/3 - Show calibrate button again (875 bytes, patch)
2012-01-10 18:13 UTC, Jason Gerecke
committed Details | Review
wacom: add 'display' key to schema (1.57 KB, patch)
2012-01-18 19:11 UTC, Jason Gerecke
committed Details | Review
wacom: Add functions to locate tablet display (7.85 KB, patch)
2012-01-18 19:11 UTC, Jason Gerecke
committed Details | Review
common: Add "type" field to the PropertyHelper struct (5.66 KB, patch)
2012-01-18 19:11 UTC, Jason Gerecke
committed Details | Review
wacom: Initialize tablet mapping and react to gsettings changes (2.61 KB, patch)
2012-01-18 19:11 UTC, Jason Gerecke
committed Details | Review
wacom: Automatically assign 'display' when heuristically found (2.34 KB, patch)
2012-01-18 19:11 UTC, Jason Gerecke
committed Details | Review
wacom: Bring over files from g-s-d (10.66 KB, patch)
2012-01-18 19:13 UTC, Jason Gerecke
committed Details | Review
wacom: Get monitor tablet has ben mapped to before calibrating (1.45 KB, patch)
2012-01-18 19:13 UTC, Jason Gerecke
committed Details | Review
wacom: Specify monitor to use when calling run_calibration (1.33 KB, patch)
2012-01-18 19:13 UTC, Jason Gerecke
committed Details | Review

Description Bastien Nocera 2011-08-26 10:41:15 UTC
SSIA. It was hidden in commit 44dddf75794010be7602bb607304b7585c0dc766.
Comment 1 Bastien Nocera 2011-10-26 10:25:28 UTC
Peter, could you please let me know what the process should be here, example code, prior art?
Comment 2 Matthias Clasen 2011-10-27 01:06:37 UTC
The best I have so far is the mockup in http://live.gnome.org/Design/SystemSettings/Tablet

which hints at tapping certain marked locations on the screen.

http://libregraphicsworld.org/blog/entry/peter-hutterer-on-the-gnome-applet-for-wacom-tablets 

may also have some information.
Comment 3 Peter Hutterer 2011-10-27 04:40:33 UTC
Basic process should be to tap on a few corners of the screen and get the coordinates from the device for these corners. Easiest to grab the device for this. The actual calibration is handled by the "Wacom Tablet Area" property which takes the active area in device coordinates.

So you need to map those points to what the device coordinates _should_ be and then compare them to the coordinates you get and calc the offset.

Main difficulty (code-wise) is that you _also_ need to take the "Coordinate Transformation Matrix" into account since that may tie the device to a screen or an area. Should be easy enough though, you multiply x/y coming from the driver with the matrix and that gives you back whatever the device gives you.

pseudo-code for first crosshair placed at 1/10 of screen width:

M = coordinate transformation matrix
get device coordinate range for x/y
display crosshair at width * 0.1/height * 0.1
grab device
get first tap coordinates
real coords = tap coords * M
tablet area x value: tap x coord - device-width/10
tablet area y value: tap y coord - device-height/10

and then the same with a second crosshair. Come to think of it, we're probably fine just displaying a crosshair top-right and bottom-left.
Comment 4 Jason Gerecke 2012-01-10 18:11:54 UTC
Created attachment 204970 [details] [review]
Patch 1/3 - Megapatch
Comment 5 Jason Gerecke 2012-01-10 18:12:32 UTC
Created attachment 204971 [details] [review]
Patch 2/3 - Wire up calibrate button to calibration utility
Comment 6 Jason Gerecke 2012-01-10 18:13:04 UTC
Created attachment 204972 [details] [review]
Patch 3/3 - Show calibrate button again
Comment 7 Jason Gerecke 2012-01-10 18:15:21 UTC
Been working on this and have a set of three patches that get calibration working again. The first is a "megapatch" that brings over a trimmed down version of xinput_calibrator. The second adds glue code into the wacom panel to start up the calibration utility when the calibration button is pressed. The third makes the calibration button visible once again.

Note to self: the contents of this field aren't saved when using "add an attachment"...
Comment 8 Bastien Nocera 2012-01-10 19:26:41 UTC
Committed with a bunch of fixes already. There's much more
to be done, especially i18n support (which probably means not
using raw cairo to print), multi-monitor support, and UI changes
to match the mockups.
Comment 9 Jason Gerecke 2012-01-18 19:11:30 UTC
Created attachment 205565 [details] [review]
wacom: add 'display' key to schema

Adds a new 'display' key to the Wacom schema which shall be used
to store EDID information about the display the tablet should be
mapped to. It should contain the data [vendor, product, serial]
if an output is set or ["", "", ""] otherwise.
Comment 10 Jason Gerecke 2012-01-18 19:11:32 UTC
Created attachment 205566 [details] [review]
wacom: Add functions to locate tablet display

Adds functions to get information about the display a tablet
should be mapped to. The "display" key in gsettings is first
consulted for EDID data and outputs scanned for a match. If
none is found, we look for one heuristically (in this case,
find a screen from vendor "WAC"). If still nothing is found,
we assume whole desktop (well, whole "screen") mapping.
Comment 11 Jason Gerecke 2012-01-18 19:11:34 UTC
Created attachment 205567 [details] [review]
common: Add "type" field to the PropertyHelper struct

This patch adds a "type" field to the PropertyHelper struct and
changes the device_set_property function to make use of this
type information. While most X properties have the type XA_INTEGER,
other types exist as well (notably the "FLOAT" type used by the
"Coordinate Transformation Matrix" property).
Comment 12 Jason Gerecke 2012-01-18 19:11:36 UTC
Created attachment 205568 [details] [review]
wacom: Initialize tablet mapping and react to gsettings changes

g-s-d sets the tablet mapping when a tablet is plugged in, as well
as when the 'display' key is changed.
Comment 13 Jason Gerecke 2012-01-18 19:11:38 UTC
Created attachment 205569 [details] [review]
wacom: Automatically assign 'display' when heuristically found

If find_output was unable to find a defined mapping, but heuristics
provided a match, go ahead and store the mapping automatically.
Comment 14 Jason Gerecke 2012-01-18 19:13:26 UTC
Created attachment 205573 [details] [review]
wacom: Bring over files from g-s-d
Comment 15 Jason Gerecke 2012-01-18 19:13:27 UTC
Created attachment 205574 [details] [review]
wacom: Get monitor tablet has ben mapped to before calibrating

More precisely, this patch cecks if the tablet *could* be mapped.
gsd_wacom_device_get_display_monitor has a side-effect of
automatically mapping the tablet if it is necessary and possible
to ensure that it *is* mapped.

If the tablet isn't and can't be mapped, calibration is pointless.
Comment 16 Jason Gerecke 2012-01-18 19:13:29 UTC
Created attachment 205575 [details] [review]
wacom: Specify monitor to use when calling run_calibration

Changes the signature of run_calibration to require the monitor
that calibration should take place on.
Comment 17 Bastien Nocera 2012-01-18 23:21:49 UTC
Attachment 205565 [details] pushed as eb8ee18 - wacom: add 'display' key to schema
Attachment 205566 [details] pushed as b5f50e4 - wacom: Add functions to locate tablet display
Attachment 205567 [details] pushed as 4727bf4 - common: Add "type" field to the PropertyHelper struct
Attachment 205568 [details] pushed as 02f0d54 - wacom: Initialize tablet mapping and react to gsettings changes
Attachment 205569 [details] pushed as f32c8ff - wacom: Automatically assign 'display' when heuristically found
Comment 18 Bastien Nocera 2012-01-18 23:44:36 UTC
All done! Thanks for the patches.