aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-12-17 15:37:15 -0500
committerLibravatar emersion <contact@emersion.fr>2018-12-25 13:31:56 +0100
commit5fca74a1f1704281e86114b567707486875c4e05 (patch)
tree706f16acd2cc9d1f45e7378bfa1cbe8082c2472e /include/sway
parentChange mouse buttons to x11 map and libevdev names (diff)
downloadsway-5fca74a1f1704281e86114b567707486875c4e05.tar.gz
sway-5fca74a1f1704281e86114b567707486875c4e05.tar.zst
sway-5fca74a1f1704281e86114b567707486875c4e05.zip
Implement hide_cursor <timeout> command
Allows the cursor to be hidden after a specified timeout in milliseconds
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/commands.h1
-rw-r--r--include/sway/config.h2
-rw-r--r--include/sway/input/cursor.h7
3 files changed, 10 insertions, 0 deletions
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;
133sway_cmd cmd_force_focus_wrapping; 133sway_cmd cmd_force_focus_wrapping;
134sway_cmd cmd_fullscreen; 134sway_cmd cmd_fullscreen;
135sway_cmd cmd_gaps; 135sway_cmd cmd_gaps;
136sway_cmd cmd_hide_cursor;
136sway_cmd cmd_hide_edge_borders; 137sway_cmd cmd_hide_edge_borders;
137sway_cmd cmd_include; 138sway_cmd cmd_include;
138sway_cmd cmd_input; 139sway_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 {
436 enum edge_border_types hide_edge_borders; 436 enum edge_border_types hide_edge_borders;
437 enum edge_border_types saved_edge_borders; 437 enum edge_border_types saved_edge_borders;
438 438
439 int hide_cursor_timeout;
440
439 // border colors 441 // border colors
440 struct { 442 struct {
441 struct border_colors focused; 443 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 @@
1#ifndef _SWAY_INPUT_CURSOR_H 1#ifndef _SWAY_INPUT_CURSOR_H
2#define _SWAY_INPUT_CURSOR_H 2#define _SWAY_INPUT_CURSOR_H
3#include <stdbool.h>
3#include <stdint.h> 4#include <stdint.h>
5#include <wlr/types/wlr_surface.h>
4#include "sway/input/seat.h" 6#include "sway/input/seat.h"
5 7
6#define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32 8#define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32
@@ -21,6 +23,8 @@ struct sway_cursor {
21 23
22 const char *image; 24 const char *image;
23 struct wl_client *image_client; 25 struct wl_client *image_client;
26 struct wlr_surface *image_surface;
27 int hotspot_x, hotspot_y;
24 28
25 struct wl_listener motion; 29 struct wl_listener motion;
26 struct wl_listener motion_absolute; 30 struct wl_listener motion_absolute;
@@ -38,6 +42,9 @@ struct sway_cursor {
38 42
39 struct wl_listener request_set_cursor; 43 struct wl_listener request_set_cursor;
40 44
45 struct wl_event_source *hide_source;
46 bool hidden;
47
41 // Mouse binding state 48 // Mouse binding state
42 uint32_t pressed_buttons[SWAY_CURSOR_PRESSED_BUTTONS_CAP]; 49 uint32_t pressed_buttons[SWAY_CURSOR_PRESSED_BUTTONS_CAP];
43 size_t pressed_button_count; 50 size_t pressed_button_count;