summaryrefslogtreecommitdiff
path: root/sway/commands/hide_cursor.c
diff options
context:
space:
mode:
authorBrian Ashworth <[email protected]>2018-12-27 00:32:15 -0500
committeremersion <[email protected]>2018-12-30 14:17:24 +0100
commit4d88c957905e7f6b2c8188d218ca22b3e6986fe4 (patch)
tree5f34ad1667607315cfbcb786ce71845a36595d82 /sway/commands/hide_cursor.c
parent09bb71f6507d86d98b5b9825f28b91ddd4b9a09b (diff)
hide_cursor: change to a seat subcommand
This makes hide_cursor a seat subcommand, which allows for seat specific timeouts.
Diffstat (limited to 'sway/commands/hide_cursor.c')
-rw-r--r--sway/commands/hide_cursor.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/sway/commands/hide_cursor.c b/sway/commands/hide_cursor.c
deleted file mode 100644
index 3778fcff..00000000
--- a/sway/commands/hide_cursor.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-#include <string.h>
-#include "sway/commands.h"
-#include "sway/config.h"
-#include "sway/input/cursor.h"
-#include "sway/input/seat.h"
-#include "stringop.h"
-
-struct cmd_results *cmd_hide_cursor(int argc, char **argv) {
- struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "hide_cursor", EXPECTED_EQUAL_TO, 1))) {
- return error;
- }
-
- char *end;
- int timeout = strtol(argv[0], &end, 10);
- if (*end) {
- return cmd_results_new(CMD_INVALID, "hide_cursor",
- "Expected an integer timeout");
- }
- if (timeout < 100 && timeout != 0) {
- timeout = 100;
- }
- config->hide_cursor_timeout = timeout;
-
- struct sway_seat *seat;
- wl_list_for_each(seat, &server.input->seats, link) {
- wl_event_source_timer_update(seat->cursor->hide_source,
- config->hide_cursor_timeout);
- }
-
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
-}