mirror of
https://github.com/swaywm/sway.git
synced 2025-01-31 05:06:45 +00:00
Update ipc-json.c
This commit is contained in:
parent
5305ccab0a
commit
62266d5da7
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue