aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/seat/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/seat/cursor.c')
-rw-r--r--sway/commands/seat/cursor.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/commands/seat/cursor.c b/sway/commands/seat/cursor.c
index 749235eb..5a8a3bc8 100644
--- a/sway/commands/seat/cursor.c
+++ b/sway/commands/seat/cursor.c
@@ -18,7 +18,7 @@ static struct cmd_results *handle_command(struct sway_cursor *cursor,
18 int argc, char **argv) { 18 int argc, char **argv) {
19 if (strcasecmp(argv[0], "move") == 0) { 19 if (strcasecmp(argv[0], "move") == 0) {
20 if (argc < 3) { 20 if (argc < 3) {
21 return cmd_results_new(CMD_INVALID, expected_syntax); 21 return cmd_results_new(CMD_INVALID, "%s", expected_syntax);
22 } 22 }
23 int delta_x = strtol(argv[1], NULL, 10); 23 int delta_x = strtol(argv[1], NULL, 10);
24 int delta_y = strtol(argv[2], NULL, 10); 24 int delta_y = strtol(argv[2], NULL, 10);
@@ -27,7 +27,7 @@ static struct cmd_results *handle_command(struct sway_cursor *cursor,
27 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); 27 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
28 } else if (strcasecmp(argv[0], "set") == 0) { 28 } else if (strcasecmp(argv[0], "set") == 0) {
29 if (argc < 3) { 29 if (argc < 3) {
30 return cmd_results_new(CMD_INVALID, expected_syntax); 30 return cmd_results_new(CMD_INVALID, "%s", expected_syntax);
31 } 31 }
32 // map absolute coords (0..1,0..1) to root container coords 32 // map absolute coords (0..1,0..1) to root container coords
33 float x = strtof(argv[1], NULL) / root->width; 33 float x = strtof(argv[1], NULL) / root->width;
@@ -37,7 +37,7 @@ static struct cmd_results *handle_command(struct sway_cursor *cursor,
37 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); 37 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
38 } else { 38 } else {
39 if (argc < 2) { 39 if (argc < 2) {
40 return cmd_results_new(CMD_INVALID, expected_syntax); 40 return cmd_results_new(CMD_INVALID, "%s", expected_syntax);
41 } 41 }
42 struct cmd_results *error = NULL; 42 struct cmd_results *error = NULL;
43 if ((error = press_or_release(cursor, argv[0], argv[1]))) { 43 if ((error = press_or_release(cursor, argv[0], argv[1]))) {
@@ -92,14 +92,14 @@ static struct cmd_results *press_or_release(struct sway_cursor *cursor,
92 } else if (strcasecmp(action, "release") == 0) { 92 } else if (strcasecmp(action, "release") == 0) {
93 state = WLR_BUTTON_RELEASED; 93 state = WLR_BUTTON_RELEASED;
94 } else { 94 } else {
95 return cmd_results_new(CMD_INVALID, expected_syntax); 95 return cmd_results_new(CMD_INVALID, "%s", expected_syntax);
96 } 96 }
97 97
98 char *message = NULL; 98 char *message = NULL;
99 button = get_mouse_button(button_str, &message); 99 button = get_mouse_button(button_str, &message);
100 if (message) { 100 if (message) {
101 struct cmd_results *error = 101 struct cmd_results *error =
102 cmd_results_new(CMD_INVALID, message); 102 cmd_results_new(CMD_INVALID, "%s", message);
103 free(message); 103 free(message);
104 return error; 104 return error;
105 } else if (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_DOWN 105 } else if (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_DOWN
@@ -111,8 +111,8 @@ static struct cmd_results *press_or_release(struct sway_cursor *cursor,
111 : WLR_AXIS_ORIENTATION_HORIZONTAL; 111 : WLR_AXIS_ORIENTATION_HORIZONTAL;
112 double delta = (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_LEFT) 112 double delta = (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_LEFT)
113 ? -1 : 1; 113 ? -1 : 1;
114 struct wlr_event_pointer_axis event = { 114 struct wlr_pointer_axis_event event = {
115 .device = NULL, 115 .pointer = NULL,
116 .time_msec = 0, 116 .time_msec = 0,
117 .source = WLR_AXIS_SOURCE_WHEEL, 117 .source = WLR_AXIS_SOURCE_WHEEL,
118 .orientation = orientation, 118 .orientation = orientation,