From 5fca74a1f1704281e86114b567707486875c4e05 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 17 Dec 2018 15:37:15 -0500 Subject: Implement hide_cursor command Allows the cursor to be hidden after a specified timeout in milliseconds --- include/sway/commands.h | 1 + include/sway/config.h | 2 ++ include/sway/input/cursor.h | 7 +++++++ 3 files changed, 10 insertions(+) (limited to 'include/sway') diff --git a/include/sway/commands.h b/include/sway/commands.h index 1f2376d0..89e18c66 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -133,6 +133,7 @@ sway_cmd cmd_force_display_urgency_hint; sway_cmd cmd_force_focus_wrapping; sway_cmd cmd_fullscreen; sway_cmd cmd_gaps; +sway_cmd cmd_hide_cursor; sway_cmd cmd_hide_edge_borders; sway_cmd cmd_include; sway_cmd cmd_input; diff --git a/include/sway/config.h b/include/sway/config.h index 6afb471a..7ee2ec71 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -436,6 +436,8 @@ struct sway_config { enum edge_border_types hide_edge_borders; enum edge_border_types saved_edge_borders; + int hide_cursor_timeout; + // border colors struct { struct border_colors focused; diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index f7e82721..8677f1b1 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h @@ -1,6 +1,8 @@ #ifndef _SWAY_INPUT_CURSOR_H #define _SWAY_INPUT_CURSOR_H +#include #include +#include #include "sway/input/seat.h" #define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32 @@ -21,6 +23,8 @@ struct sway_cursor { const char *image; struct wl_client *image_client; + struct wlr_surface *image_surface; + int hotspot_x, hotspot_y; struct wl_listener motion; struct wl_listener motion_absolute; @@ -38,6 +42,9 @@ struct sway_cursor { struct wl_listener request_set_cursor; + struct wl_event_source *hide_source; + bool hidden; + // Mouse binding state uint32_t pressed_buttons[SWAY_CURSOR_PRESSED_BUTTONS_CAP]; size_t pressed_button_count; -- cgit v1.2.3-54-g00ecf