From ddd6004b275dd9a24f26e03dead90f0fffb0cc3e Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 27 Jun 2023 18:40:44 +0200 Subject: render: don’t (can’t) use cursor-shape-v1 when user has set a custom cursor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Well, we _could_, but we’d have to reverse map the string to a cursor-shape-v1 enum value. Let’s not do that, for now at least. --- render.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index d7cc9dfb..b0b1ec32 100644 --- a/render.c +++ b/render.c @@ -4271,7 +4271,9 @@ render_xcursor_update(struct seat *seat) xassert(seat->pointer.cursor != NULL); #if defined(HAVE_CURSOR_SHAPE) - if (seat->pointer.shape_device != NULL) { + if (seat->pointer.shape_device != NULL && + seat->pointer.shape != CURSOR_SHAPE_CUSTOM) + { LOG_DBG("setting cursor shape using cursor-shape-v1"); wp_cursor_shape_device_v1_set_shape( seat->pointer.shape_device, @@ -4449,7 +4451,8 @@ render_refresh_urls(struct terminal *term) } bool -render_xcursor_set(struct seat *seat, struct terminal *term, enum cursor_shape shape) +render_xcursor_set(struct seat *seat, struct terminal *term, + enum cursor_shape shape) { if (seat->pointer.theme == NULL) return false; @@ -4469,7 +4472,9 @@ render_xcursor_set(struct seat *seat, struct terminal *term, enum cursor_shape s /* TODO: skip this when using server-side cursors */ if (shape != CURSOR_SHAPE_HIDDEN) { - const char *const xcursor = cursor_shape_to_string(shape); + const char *const xcursor = shape == CURSOR_SHAPE_CUSTOM + ? term->mouse_user_cursor + : cursor_shape_to_string(shape); const char *const fallback = cursor_shape_to_string(CURSOR_SHAPE_TEXT_FALLBACK); -- cgit v1.3