diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 58356d4ea..0abccb2c6 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1129,12 +1129,16 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) { if (device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) { struct input_config *ic = input_device_get_config(device); float scroll_factor = 1.0f; - if (ic != NULL && !isnan(ic->scroll_factor) && - ic->scroll_factor != FLT_MIN) { - scroll_factor = ic->scroll_factor; + float sensitivity = 1.0f; + if (ic != NULL) { + if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) { + scroll_factor = ic->scroll_factor; + } + + if (!isnan(ic->sensitivity) && ic->sensitivity != FLT_MIN) { + sensitivity = ic->sensitivity; + } } - json_object_object_add(object, "scroll_factor", - json_object_new_double(scroll_factor)); } #if WLR_HAS_LIBINPUT_BACKEND