*/
void cursor_update_focus(struct server *server);
+/**
+ * cursor_update_image - re-set the labwc cursor image
+ * @seat - seat
+ *
+ * This can be used to update the cursor image on output scale changes.
+ * If the current cursor image was not set by labwc but some client
+ * this is a no-op.
+ */
+void cursor_update_image(struct seat *seat);
+
void cursor_init(struct seat *seat);
void cursor_finish(struct seat *seat);
seat->server_cursor = cursor;
}
+void
+cursor_update_image(struct seat *seat)
+{
+ enum lab_cursors cursor = seat->server_cursor;
+ if (cursor == LAB_CURSOR_CLIENT) {
+ return;
+ }
+ wlr_xcursor_manager_set_cursor_image(
+ seat->xcursor_manager, cursor_names[cursor], seat->cursor);
+}
+
bool
input_inhibit_blocks_surface(struct seat *seat, struct wl_resource *resource)
{
/*
* "Move" each wlr_output_cursor (in per-output coordinates) to
- * align with the seat cursor. Set a default cursor image so
- * that the cursor isn't invisible on new outputs.
- *
- * TODO: remember the most recent cursor image (see cursor.c)
- * and set that rather than XCURSOR_DEFAULT
+ * align with the seat cursor. Re-set the cursor image so that
+ * the cursor isn't invisible on new outputs.
*/
wlr_cursor_move(server->seat.cursor, NULL, 0, 0);
- wlr_xcursor_manager_set_cursor_image(server->seat.xcursor_manager,
- XCURSOR_DEFAULT, server->seat.cursor);
+ cursor_update_image(&server->seat);
}
static void
/* Re-set cursor image in case scale changed */
cursor_update_focus(server);
+ cursor_update_image(&server->seat);
}
/*