Skip to content

Commit

Permalink
libinput: make set_calibration_matrix verbose
Browse files Browse the repository at this point in the history
This is for debugging purposes only. Do not merge this
  • Loading branch information
RedSoxFan committed Aug 3, 2019
1 parent e07e4c5 commit 6600a8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sway/input/libinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,20 @@ static bool set_dwt(struct libinput_device *device, bool dwt) {

static bool set_calibration_matrix(struct libinput_device *dev, float mat[6]) {
if (!libinput_device_config_calibration_has_matrix(dev)) {
sway_log(SWAY_DEBUG, "set_calibration_matrix: not supported");
return false;
}
bool changed = false;
float current[6];
libinput_device_config_calibration_get_matrix(dev, current);
if (libinput_device_config_calibration_get_matrix(dev, current)) {
sway_log(SWAY_DEBUG, "set_calibration_matrix: retrieved matrix");
} else {
sway_log(SWAY_DEBUG, "set_calibration_matrix: identity matrix");
}
for (int i = 0; i < 6; i++) {
sway_log(SWAY_DEBUG,
"set_calibration_matrix: current[%d]=%f mat[%d]=%f",
i, current[i], i, mat[i]);
if (current[i] != mat[i]) {
changed = true;
break;
Expand Down

0 comments on commit 6600a8f

Please sign in to comment.