cursor: reload cursor on Reconfigure

This gives instant feedback when changing cursor theme or size.
It only works for server side cursors or clients using the
cursor-shape protocol.

Fixes: #1619
This commit is contained in:
Consolatis 2024-05-03 14:18:43 +02:00 committed by Johan Malm
parent 4b6efb7307
commit 8d4f295440
3 changed files with 11 additions and 3 deletions

View file

@ -299,6 +299,7 @@ cursor_update_image(struct seat *seat)
*/
if (seat->seat->pointer_state.focused_surface) {
seat->server_cursor = LAB_CURSOR_DEFAULT;
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager, "");
cursor_update_focus(seat->server);
}
return;
@ -1254,7 +1255,7 @@ cursor_frame(struct wl_listener *listener, void *data)
wlr_seat_pointer_notify_frame(seat->seat);
}
void
static void
cursor_load(struct seat *seat)
{
const char *xcursor_theme = getenv("XCURSOR_THEME");
@ -1300,6 +1301,13 @@ cursor_load(struct seat *seat)
}
}
void
cursor_reload(struct seat *seat)
{
cursor_load(seat);
cursor_update_image(seat);
}
void
cursor_init(struct seat *seat)
{