aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-31 15:09:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-31 15:09:06 +0000
commitd4ee9be4d767ff4927c9e322bdbf958841dc091d (patch)
treeab8adafe11e3bae878f38e9559b1abbf937f48a1 /render.c
parentconfig: configuration errors are no longer fatal (diff)
config: add 'hide-when-typing'
When enabled, the mouse cursor is hidden when the user types in the terminal. It is un-hidden when the user moves the mouse, or when the window loses keyboard focus.
Diffstat (limited to 'render.c')
-rw-r--r--render.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/render.c b/render.c
index 081b7641..e0e9f3a5 100644
--- a/render.c
+++ b/render.c
@@ -2105,6 +2105,15 @@ render_xcursor_update(struct seat *seat)
if (!seat->mouse_focus)
return;
+ assert(seat->pointer.xcursor != NULL);
+
+ if (seat->pointer.xcursor == XCURSOR_HIDDEN) {
+ /* Hide cursor */
+ wl_surface_attach(seat->pointer.surface, NULL, 0, 0);
+ wl_surface_commit(seat->pointer.surface);
+ return;
+ }
+
seat->pointer.cursor = wl_cursor_theme_get_cursor(
seat->pointer.theme, seat->pointer.xcursor);