wacom: Get monitor tablet has ben mapped to before calibrating

More precisely, this patch checks 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.

https://bugzilla.gnome.org/show_bug.cgi?id=657423
This commit is contained in:
Jason Gerecke 2012-01-12 13:02:22 -08:00 committed by Bastien Nocera
parent 4eae26e967
commit 611a91b91f

View file

@ -156,6 +156,16 @@ calibrate_button_clicked_cb (GtkButton *button,
GVariant *variant;
int *current;
gsize ncal;
gint monitor;
monitor = gsd_wacom_device_get_display_monitor (page->priv->stylus);
if (monitor < 0) {
/* The display the tablet should be mapped to could not be located.
* This shouldn't happen if the EDID data is good...
*/
g_critical("Output associated with the tablet is not connected. Unable to calibrate.");
return;
}
variant = g_settings_get_value (page->priv->wacom_settings, "area");
current = (int *) g_variant_get_fixed_array (variant, &ncal, sizeof (gint32));