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.
This commit is contained in:
Daniel Eklöf 2020-07-31 17:09:06 +02:00
parent b00dfcf7b6
commit d4ee9be4d7
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
11 changed files with 57 additions and 16 deletions

View file

@ -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);