From 91559fe48012da7b521a331c5c06da1cee628a0f Mon Sep 17 00:00:00 2001 From: Ashish SHUKLA Date: Mon, 7 Feb 2022 20:31:20 +0530 Subject: [PATCH 1/3] pgo: add stub for render_xcursor_is_valid --- pgo/pgo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pgo/pgo.c b/pgo/pgo.c index 2b7245d0..a9a89477 100644 --- a/pgo/pgo.c +++ b/pgo/pgo.c @@ -68,6 +68,12 @@ void render_refresh(struct terminal *term) {} void render_refresh_csd(struct terminal *term) {} void render_refresh_title(struct terminal *term) {} +bool +render_xcursor_is_valid(const struct seat *seat, const char *cursor) +{ + return true; +} + bool render_xcursor_set(struct seat *seat, struct terminal *term, const char *xcursor) { From 4df73585e79485280fda2e60c18bbac36eaee491 Mon Sep 17 00:00:00 2001 From: Ashish SHUKLA Date: Mon, 7 Feb 2022 20:32:28 +0530 Subject: [PATCH 2/3] Specify a fallback mouse cursor `text' cursor is not available in lots of cursor themes, but `xterm' is, so specify `xterm' as a fallback cursor name. --- render.c | 8 ++++++-- terminal.c | 1 + terminal.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/render.c b/render.c index 65c39bf8..d873aa79 100644 --- a/render.c +++ b/render.c @@ -4017,8 +4017,12 @@ render_xcursor_set(struct seat *seat, struct terminal *term, const char *xcursor seat->pointer.theme, xcursor); if (seat->pointer.cursor == NULL) { - LOG_ERR("failed to load xcursor pointer '%s'", xcursor); - return false; + seat->pointer.cursor = wl_cursor_theme_get_cursor( + seat->pointer.theme, XCURSOR_TEXT_FALLBACK ); + if (seat->pointer.cursor == NULL) { + LOG_ERR("failed to load xcursor pointer '%s', and fallback '%s'", xcursor, XCURSOR_TEXT_FALLBACK); + return false; + } } } else seat->pointer.cursor = NULL; diff --git a/terminal.c b/terminal.c index 27ea033a..3076340c 100644 --- a/terminal.c +++ b/terminal.c @@ -48,6 +48,7 @@ const char *const XCURSOR_HIDDEN = "hidden"; const char *const XCURSOR_LEFT_PTR = "left_ptr"; const char *const XCURSOR_TEXT = "text"; +const char *const XCURSOR_TEXT_FALLBACK = "xterm"; //const char *const XCURSOR_HAND2 = "hand2"; const char *const XCURSOR_TOP_LEFT_CORNER = "top_left_corner"; const char *const XCURSOR_TOP_RIGHT_CORNER = "top_right_corner"; diff --git a/terminal.h b/terminal.h index 187a5187..d3602383 100644 --- a/terminal.h +++ b/terminal.h @@ -664,6 +664,7 @@ struct terminal { extern const char *const XCURSOR_HIDDEN; extern const char *const XCURSOR_LEFT_PTR; extern const char *const XCURSOR_TEXT; +extern const char *const XCURSOR_TEXT_FALLBACK; //extern const char *const XCURSOR_HAND2; extern const char *const XCURSOR_TOP_LEFT_CORNER; extern const char *const XCURSOR_TOP_RIGHT_CORNER; From 5631f16a6208832d75d4120b1c5d4512dc4e9109 Mon Sep 17 00:00:00 2001 From: Ashish SHUKLA Date: Mon, 7 Feb 2022 22:01:23 +0530 Subject: [PATCH 3/3] changelog: fallback xcursor --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21383e45..74499326 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ ### Added * OSC-22 - set xcursor pointer. - +* Add "xterm" as fallback cursor where "text" is not available. ### Changed