From 84dd73d02191aabe5708c23fbc09075a8f9a7468 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 07:34:03 +0200 Subject: [PATCH 01/24] Update commands.h --- include/sway/commands.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sway/commands.h b/include/sway/commands.h index 270585870..552984fa2 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -261,6 +261,7 @@ sway_cmd input_cmd_map_to_region; sway_cmd input_cmd_middle_emulation; sway_cmd input_cmd_natural_scroll; sway_cmd input_cmd_pointer_accel; +sway_cmd input_cmd_sensitivity; sway_cmd input_cmd_rotation_angle; sway_cmd input_cmd_scroll_factor; sway_cmd input_cmd_repeat_delay; From 919ea1531afcd8b624cacdeccc9af0d0f916372b Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 07:37:55 +0200 Subject: [PATCH 02/24] Update config.h --- include/sway/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sway/config.h b/include/sway/config.h index f9da19675..7fb12c7a3 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -156,6 +156,7 @@ struct input_config { int middle_emulation; int natural_scroll; float pointer_accel; + float sensitivity; float rotation_angle; float scroll_factor; int repeat_delay; From fef41686d6c69a44dabfe946e716aeb947864cae Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 07:39:19 +0200 Subject: [PATCH 03/24] Update input-manager.h --- include/sway/input/input-manager.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index b651e3dd9..af431a372 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h @@ -74,4 +74,6 @@ char *input_device_get_identifier(struct wlr_input_device *device); const char *input_device_get_type(struct sway_input_device *device); +struct sway_input_device *input_sway_device_from_wlr(struct wlr_input_device *device); + #endif From 0bb8dd8c855d53ac8ee28d04fc3441862cc4f270 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 07:41:16 +0200 Subject: [PATCH 04/24] Create sensitivity.c --- sway/commands/input/sensitivity.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sway/commands/input/sensitivity.c diff --git a/sway/commands/input/sensitivity.c b/sway/commands/input/sensitivity.c new file mode 100644 index 000000000..d57bcff05 --- /dev/null +++ b/sway/commands/input/sensitivity.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include "sway/config.h" +#include "sway/commands.h" +#include "sway/input/input-manager.h" +#include "util.h" + +struct cmd_results *input_cmd_sensitivity(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "sensitivity", EXPECTED_AT_LEAST, 1))) { + return error; + } + struct input_config *ic = config->handler_context.input_config; + if (!ic) { + return cmd_results_new(CMD_FAILURE, "No input device defined."); + } + + float sensitivity = parse_float(argv[0]); + if (isnan(sensitivity)) { + return cmd_results_new(CMD_INVALID, + "Invalid sensitivity; expected float."); + } else if (sensitivity < 0) { + return cmd_results_new(CMD_INVALID, + "Sensitivity cannot be negative."); + } + ic->sensitivity = sensitivity; + + return cmd_results_new(CMD_SUCCESS, NULL); +} From 4d87b7ba9ec4ff11ad0a175e0082d3f2f1677c76 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 08:04:46 +0200 Subject: [PATCH 05/24] Update input.c --- sway/config/input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/config/input.c b/sway/config/input.c index 44c2be289..fd74d84c7 100644 --- a/sway/config/input.c +++ b/sway/config/input.c @@ -33,6 +33,7 @@ struct input_config *new_input_config(const char* identifier) { input->accel_profile = INT_MIN; input->rotation_angle = FLT_MIN; input->pointer_accel = FLT_MIN; + input->sensitivity = FLT_MIN; input->scroll_factor = FLT_MIN; input->scroll_button = INT_MIN; input->scroll_button_lock = INT_MIN; @@ -82,6 +83,9 @@ void merge_input_config(struct input_config *dst, struct input_config *src) { if (src->pointer_accel != FLT_MIN) { dst->pointer_accel = src->pointer_accel; } + if (src->sensitivity != FLT_MIN) { + dst->sensitivity = src->sensitivity; + } if (src->scroll_factor != FLT_MIN) { dst->scroll_factor = src->scroll_factor; } From ec3e47df91dfa991b96d7c13cb70d5a554493579 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:29:09 +0200 Subject: [PATCH 06/24] Update cursor.c --- sway/input/cursor.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 44a5d6f7b..b78719dcc 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -1,6 +1,7 @@ #define _POSIX_C_SOURCE 200809L #include #include +#include #include #include #include @@ -22,6 +23,7 @@ #include "sway/commands.h" #include "sway/desktop.h" #include "sway/input/cursor.h" +#include "sway/input/input-manager.h" #include "sway/input/keyboard.h" #include "sway/input/tablet.h" #include "sway/layers.h" @@ -30,7 +32,8 @@ #include "sway/tree/root.h" #include "sway/tree/view.h" #include "sway/tree/workspace.h" -#include "wlr-layer-shell-unstable-v1-protocol.h" +#include "sway/commands.h" +#include "sway/config.h" static uint32_t get_current_time_msec(void) { struct timespec now; @@ -415,6 +418,11 @@ static void handle_pointer_motion_absolute( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion_absolute); struct wlr_pointer_motion_absolute_event *event = data; + + struct sway_input_device *sid = input_sway_device_from_wlr(event->device); + struct input_config *ic = sid ? input_device_get_config(sid) : NULL; + float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; + cursor_handle_activity_from_device(cursor, &event->pointer->base); double lx, ly; @@ -424,7 +432,7 @@ static void handle_pointer_motion_absolute( double dx = lx - cursor->cursor->x; double dy = ly - cursor->cursor->y; - pointer_motion(cursor, event->time_msec, &event->pointer->base, dx, dy, + pointer_motion(cursor, event->time_msec, &event->pointer->base, dx * sensitivity, dy * sensitivity, dx, dy); } From 5305ccab0a1738cedc6debc01c59dd2160bfe6f3 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:30:03 +0200 Subject: [PATCH 07/24] Update input-manager.c --- sway/input/input-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index db82bb4c8..c61365927 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -154,7 +154,7 @@ static void apply_input_type_config(struct sway_input_device *input_device) { } } -static struct sway_input_device *input_sway_device_from_wlr( +struct sway_input_device *input_sway_device_from_wlr( struct wlr_input_device *device) { struct sway_input_device *input_device = NULL; wl_list_for_each(input_device, &server.input->devices, link) { From 62266d5da78c582d8665b58e058bdc3e3eac0a8c Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:35:00 +0200 Subject: [PATCH 08/24] Update ipc-json.c --- sway/ipc-json.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 From 4f5753dd6bcbed91e444bd20de9d0f4a72bb6cb3 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:35:38 +0200 Subject: [PATCH 09/24] Update meson.build --- sway/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/sway/meson.build b/sway/meson.build index 3abd778db..b56a63696 100644 --- a/sway/meson.build +++ b/sway/meson.build @@ -167,6 +167,7 @@ sway_sources = files( 'commands/input/middle_emulation.c', 'commands/input/natural_scroll.c', 'commands/input/pointer_accel.c', + 'commands/input/sensitivity.c', 'commands/input/rotation_angle.c', 'commands/input/repeat_delay.c', 'commands/input/repeat_rate.c', From ec7e1681fcd66f5721a17d241bd2717ff8898413 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:36:27 +0200 Subject: [PATCH 10/24] Update sway-input.5.scd --- sway/sway-input.5.scd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/sway-input.5.scd b/sway/sway-input.5.scd index 8a1f27001..a622350ec 100644 --- a/sway/sway-input.5.scd +++ b/sway/sway-input.5.scd @@ -175,6 +175,10 @@ The following commands may only be used in the configuration file. *input* pointer_accel [<-1|1>] Changes the pointer acceleration for the specified input device. +*input* sensitivity + Multiplies the sensitivity of a relative pointing input device. Has no + effect on absolute pointing devices. + *input* rotation_angle Sets the rotation angle of the device to the given clockwise angle in degrees. The angle must be between 0.0 (inclusive) and 360.0 (exclusive). From 9932197d1657ec57f03ee6eceb929d03e14a4c71 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:37:18 +0200 Subject: [PATCH 11/24] Update sway-ipc.7.scd --- sway/sway-ipc.7.scd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd index f4a5ccff2..9d9843a94 100644 --- a/sway/sway-ipc.7.scd +++ b/sway/sway-ipc.7.scd @@ -1138,6 +1138,9 @@ following properties: |- scroll_factor : floating : (Only pointers) Multiplier applied on scroll event values. +|- sensitivity +: floating +: (Only pointers) Multiplier applied on relative pointer movements. |- libinput : object : (Only libinput devices) An object describing the current device settings. From 094c0004a6a42b76303793e9b91d80679275db58 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:20:38 +0200 Subject: [PATCH 12/24] Update cursor.c --- sway/input/cursor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index b78719dcc..dbb6b08bc 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -407,6 +407,11 @@ static void handle_pointer_motion_relative( struct wl_listener *listener, void *data) { struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct wlr_pointer_motion_event *e = data; + + struct sway_input_device *sid = input_sway_device_from_wlr(e->device); + struct input_config *ic = sid ? input_device_get_config(sid) : NULL; + float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; + cursor_handle_activity_from_device(cursor, &e->pointer->base); pointer_motion(cursor, e->time_msec, &e->pointer->base, e->delta_x, @@ -418,11 +423,6 @@ static void handle_pointer_motion_absolute( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion_absolute); struct wlr_pointer_motion_absolute_event *event = data; - - struct sway_input_device *sid = input_sway_device_from_wlr(event->device); - struct input_config *ic = sid ? input_device_get_config(sid) : NULL; - float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; - cursor_handle_activity_from_device(cursor, &event->pointer->base); double lx, ly; From f2ebfc25b703594f1dd06acaa136203b3930eeab Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:26:44 +0200 Subject: [PATCH 13/24] Update cursor.c --- sway/input/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index dbb6b08bc..b6c4b1051 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -408,7 +408,7 @@ static void handle_pointer_motion_relative( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct wlr_pointer_motion_event *e = data; - struct sway_input_device *sid = input_sway_device_from_wlr(e->device); + struct sway_input_device *sid = input_sway_device_from_wlr(e->pointer->base); struct input_config *ic = sid ? input_device_get_config(sid) : NULL; float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; From a2c9e8f7e189d35ff147841803be640c812f0b9b Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:27:32 +0200 Subject: [PATCH 14/24] Update cursor.c --- sway/input/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index b6c4b1051..6c5dd8093 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -408,7 +408,7 @@ static void handle_pointer_motion_relative( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct wlr_pointer_motion_event *e = data; - struct sway_input_device *sid = input_sway_device_from_wlr(e->pointer->base); + struct sway_input_device *sid = input_sway_device_from_wlr(e->pointer); struct input_config *ic = sid ? input_device_get_config(sid) : NULL; float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; From 3996e54dfb5f4c9125cc747da320e4cc57a0296d Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:29:11 +0200 Subject: [PATCH 15/24] Update cursor.c --- sway/input/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 6c5dd8093..42d772967 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -408,7 +408,7 @@ static void handle_pointer_motion_relative( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct wlr_pointer_motion_event *e = data; - struct sway_input_device *sid = input_sway_device_from_wlr(e->pointer); + struct sway_input_device *sid = input_sway_device_from_wlr(e->cursor); struct input_config *ic = sid ? input_device_get_config(sid) : NULL; float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; From 23ad8be5355bae8c9654121c1e028bfe28498931 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:31:03 +0200 Subject: [PATCH 16/24] Update cursor.c --- sway/input/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 42d772967..b6c4b1051 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -408,7 +408,7 @@ static void handle_pointer_motion_relative( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct wlr_pointer_motion_event *e = data; - struct sway_input_device *sid = input_sway_device_from_wlr(e->cursor); + struct sway_input_device *sid = input_sway_device_from_wlr(e->pointer->base); struct input_config *ic = sid ? input_device_get_config(sid) : NULL; float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; From bda7f681e7d991df4116229ee7066aa17c30252f Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:32:36 +0200 Subject: [PATCH 17/24] Update cursor.c --- sway/input/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index b6c4b1051..84e3aa1a3 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -408,7 +408,7 @@ static void handle_pointer_motion_relative( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct wlr_pointer_motion_event *e = data; - struct sway_input_device *sid = input_sway_device_from_wlr(e->pointer->base); + struct sway_input_device *sid = input_sway_device_from_wlr(&e->pointer->base); struct input_config *ic = sid ? input_device_get_config(sid) : NULL; float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; From 47ac4cd87ebcfb92ce8ee8e50db1fb342ed29a5d Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:35:06 +0200 Subject: [PATCH 18/24] Update cursor.c --- sway/input/cursor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 84e3aa1a3..901f43528 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -414,8 +414,8 @@ static void handle_pointer_motion_relative( cursor_handle_activity_from_device(cursor, &e->pointer->base); - pointer_motion(cursor, e->time_msec, &e->pointer->base, e->delta_x, - e->delta_y, e->unaccel_dx, e->unaccel_dy); + pointer_motion(cursor, e->time_msec, &e->pointer->base, e->delta_x * sensitivity, + e->delta_y * sensitivity, e->unaccel_dx, e->unaccel_dy); } static void handle_pointer_motion_absolute( @@ -432,7 +432,7 @@ static void handle_pointer_motion_absolute( double dx = lx - cursor->cursor->x; double dy = ly - cursor->cursor->y; - pointer_motion(cursor, event->time_msec, &event->pointer->base, dx * sensitivity, dy * sensitivity, + pointer_motion(cursor, event->time_msec, &event->pointer->base, dx, dy, dx, dy); } From 475e289226f95345096279d434cd6ade73ada651 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:56:41 +0200 Subject: [PATCH 19/24] Update input.c --- sway/commands/input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sway/commands/input.c b/sway/commands/input.c index 306c40f74..ef981cc5b 100644 --- a/sway/commands/input.c +++ b/sway/commands/input.c @@ -30,6 +30,7 @@ static const struct cmd_handler input_handlers[] = { { "scroll_button_lock", input_cmd_scroll_button_lock }, { "scroll_factor", input_cmd_scroll_factor }, { "scroll_method", input_cmd_scroll_method }, + { "sensitivity", input_cmd_sensitivity }, { "tap", input_cmd_tap }, { "tap_button_map", input_cmd_tap_button_map }, { "tool_mode", input_cmd_tool_mode }, From 48c0c0b9d6d1a366fe61c5b39a6f86bb469886e3 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Mon, 18 Sep 2023 12:13:47 +0200 Subject: [PATCH 20/24] Update ipc-json.c --- sway/ipc-json.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 0abccb2c6..9edd0f1a4 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1128,8 +1128,6 @@ 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; - float sensitivity = 1.0f; if (ic != NULL) { if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) { scroll_factor = ic->scroll_factor; From 3149f533fe28b47050e20be4636b5971a2d61a77 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Mon, 18 Sep 2023 12:37:18 +0200 Subject: [PATCH 21/24] Update ipc-json.c --- sway/ipc-json.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 9edd0f1a4..0abccb2c6 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1128,6 +1128,8 @@ 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; + float sensitivity = 1.0f; if (ic != NULL) { if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) { scroll_factor = ic->scroll_factor; From db98bdd4d2faccfe7ccc61024298af1706dba2ca Mon Sep 17 00:00:00 2001 From: jlo62 Date: Mon, 18 Sep 2023 18:02:56 +0200 Subject: [PATCH 22/24] Revert "Update ipc-json.c" This reverts commit 3149f533fe28b47050e20be4636b5971a2d61a77. --- sway/ipc-json.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 0abccb2c6..9edd0f1a4 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1128,8 +1128,6 @@ 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; - float sensitivity = 1.0f; if (ic != NULL) { if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) { scroll_factor = ic->scroll_factor; From a441c20a46a003a493363180c2354abe3ee583a1 Mon Sep 17 00:00:00 2001 From: jlo62 Date: Mon, 18 Sep 2023 18:03:14 +0200 Subject: [PATCH 23/24] Revert "Update ipc-json.c" This reverts commit 48c0c0b9d6d1a366fe61c5b39a6f86bb469886e3. --- sway/ipc-json.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 9edd0f1a4..0abccb2c6 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1128,6 +1128,8 @@ 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; + float sensitivity = 1.0f; if (ic != NULL) { if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) { scroll_factor = ic->scroll_factor; From 026b3a6324cb403f1c45e74d91579282a0c97991 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:14:14 +0200 Subject: [PATCH 24/24] Update ipc-json.c --- sway/ipc-json.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 0abccb2c6..2b8ee0ca8 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1130,6 +1130,8 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) { struct input_config *ic = input_device_get_config(device); float scroll_factor = 1.0f; float sensitivity = 1.0f; + (void)scroll_factor; + (void)sensitivity; if (ic != NULL) { if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) { scroll_factor = ic->scroll_factor;