summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2020-05-28 20:56:28 -0400
committerLibravatar Tudor Brindus <me@tbrindus.ca>2020-05-29 15:37:40 -0400
commit8cdcb77e12bf9c52fb51ce9a7da7e6a850fa5a37 (patch)
tree28462ce56e4615f30a5a3ad4a097b161d568e545 /sway
parentinput/cursor: rename `simulated_tool_tip_down` to be more accurate (diff)
downloadsway-8cdcb77e12bf9c52fb51ce9a7da7e6a850fa5a37.tar.gz
sway-8cdcb77e12bf9c52fb51ce9a7da7e6a850fa5a37.tar.zst
sway-8cdcb77e12bf9c52fb51ce9a7da7e6a850fa5a37.zip
seat_cmd_cursor: emit frame events
This emits frame events for the seat_cmd_cursor subcommands. The wl_pointer frame event are required to notify clients when to process the events. It will now be emitted after cursor movement, button press, button release, and axis events.
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/seat/cursor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/seat/cursor.c b/sway/commands/seat/cursor.c
index c09020d3..ad7dc905 100644
--- a/sway/commands/seat/cursor.c
+++ b/sway/commands/seat/cursor.c
@@ -24,6 +24,7 @@ static struct cmd_results *handle_command(struct sway_cursor *cursor,
24 int delta_y = strtol(argv[2], NULL, 10); 24 int delta_y = strtol(argv[2], NULL, 10);
25 wlr_cursor_move(cursor->cursor, NULL, delta_x, delta_y); 25 wlr_cursor_move(cursor->cursor, NULL, delta_x, delta_y);
26 cursor_rebase(cursor); 26 cursor_rebase(cursor);
27 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
27 } else if (strcasecmp(argv[0], "set") == 0) { 28 } else if (strcasecmp(argv[0], "set") == 0) {
28 if (argc < 3) { 29 if (argc < 3) {
29 return cmd_results_new(CMD_INVALID, expected_syntax); 30 return cmd_results_new(CMD_INVALID, expected_syntax);
@@ -33,6 +34,7 @@ static struct cmd_results *handle_command(struct sway_cursor *cursor,
33 float y = strtof(argv[2], NULL) / root->height; 34 float y = strtof(argv[2], NULL) / root->height;
34 wlr_cursor_warp_absolute(cursor->cursor, NULL, x, y); 35 wlr_cursor_warp_absolute(cursor->cursor, NULL, x, y);
35 cursor_rebase(cursor); 36 cursor_rebase(cursor);
37 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
36 } else { 38 } else {
37 if (argc < 2) { 39 if (argc < 2) {
38 return cmd_results_new(CMD_INVALID, expected_syntax); 40 return cmd_results_new(CMD_INVALID, expected_syntax);
@@ -117,10 +119,12 @@ static struct cmd_results *press_or_release(struct sway_cursor *cursor,
117 .delta_discrete = delta 119 .delta_discrete = delta
118 }; 120 };
119 dispatch_cursor_axis(cursor, &event); 121 dispatch_cursor_axis(cursor, &event);
122 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
120 return cmd_results_new(CMD_SUCCESS, NULL); 123 return cmd_results_new(CMD_SUCCESS, NULL);
121 } else if (!button) { 124 } else if (!button) {
122 return cmd_results_new(CMD_INVALID, "Unknown button %s", button_str); 125 return cmd_results_new(CMD_INVALID, "Unknown button %s", button_str);
123 } 126 }
124 dispatch_cursor_button(cursor, NULL, 0, button, state); 127 dispatch_cursor_button(cursor, NULL, 0, button, state);
128 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
125 return cmd_results_new(CMD_SUCCESS, NULL); 129 return cmd_results_new(CMD_SUCCESS, NULL);
126} 130}