mirror of
https://github.com/swaywm/sway.git
synced 2026-04-14 08:22:08 -04:00
Introduce cursor_rebase
This function "rebases" the cursor on top of whatever is underneath it, without triggering any focus changes.
This commit is contained in:
parent
28f3b8cb03
commit
9ea71f292b
8 changed files with 78 additions and 51 deletions
|
|
@ -36,7 +36,7 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
|
|||
int delta_x = strtol(argv[1], NULL, 10);
|
||||
int delta_y = strtol(argv[2], NULL, 10);
|
||||
wlr_cursor_move(cursor->cursor, NULL, delta_x, delta_y);
|
||||
cursor_send_pointer_motion(cursor, 0, true);
|
||||
cursor_rebase(cursor);
|
||||
} else if (strcasecmp(argv[0], "set") == 0) {
|
||||
if (argc < 3) {
|
||||
return cmd_results_new(CMD_INVALID, "cursor", expected_syntax);
|
||||
|
|
@ -45,7 +45,7 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
|
|||
float x = strtof(argv[1], NULL) / root->width;
|
||||
float y = strtof(argv[2], NULL) / root->height;
|
||||
wlr_cursor_warp_absolute(cursor->cursor, NULL, x, y);
|
||||
cursor_send_pointer_motion(cursor, 0, true);
|
||||
cursor_rebase(cursor);
|
||||
} else {
|
||||
if (argc < 2) {
|
||||
return cmd_results_new(CMD_INVALID, "cursor", expected_syntax);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue