aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-06-15 18:40:33 +0200
committerSimon Ser <contact@emersion.fr>2023-06-15 18:40:33 +0200
commit220402b717951d3bdcce79783319eef6bbee9da4 (patch)
tree3c8061119ded1874c557fda13595295d16f959c0
parentda04b066ea037be0fdc5d79ac6b214fea6f2d3c5 (diff)
cursor: add wlr_cursor_unset_image()
It's pretty awkward to call wlr_cursor_set_image() with 6 zeroes. Hide that awkwardness in wlroots.
-rw-r--r--include/wlr/types/wlr_cursor.h5
-rw-r--r--types/wlr_cursor.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_cursor.h b/include/wlr/types/wlr_cursor.h
index f3c7e970..a4c2e731 100644
--- a/include/wlr/types/wlr_cursor.h
+++ b/include/wlr/types/wlr_cursor.h
@@ -148,6 +148,11 @@ void wlr_cursor_set_image(struct wlr_cursor *cur, const uint8_t *pixels,
int32_t hotspot_y, float scale);
/**
+ * Hide the cursor image.
+ */
+void wlr_cursor_unset_image(struct wlr_cursor *cur);
+
+/**
* Set the cursor image from an XCursor theme.
*
* The image will be loaded from the struct wlr_xcursor_manager.
diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c
index cce37e81..8b568e38 100644
--- a/types/wlr_cursor.c
+++ b/types/wlr_cursor.c
@@ -425,6 +425,10 @@ void wlr_cursor_set_image(struct wlr_cursor *cur, const uint8_t *pixels,
}
}
+void wlr_cursor_unset_image(struct wlr_cursor *cur) {
+ wlr_cursor_set_image(cur, NULL, 0, 0, 0, 0, 0, 0);
+}
+
void wlr_cursor_set_xcursor(struct wlr_cursor *cur,
struct wlr_xcursor_manager *manager, const char *name) {
struct wlr_cursor_output_cursor *output_cursor;