aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-02-07 17:07:35 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-02-07 17:07:35 +0000
commitc9da1dc152960726e09ad295484b53775fd6d4cc (patch)
tree5836ca461ccf82030c51a90629d56ad712f341f4
parentdoc: ctlseq: OSC-22 (diff)
parentchangelog: fallback xcursor (diff)
Merge branch 'fallback-mouse-cursor'
Closes #738
-rw-r--r--CHANGELOG.md2
-rw-r--r--pgo/pgo.c6
-rw-r--r--render.c8
-rw-r--r--terminal.c1
-rw-r--r--terminal.h1
5 files changed, 15 insertions, 3 deletions
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
diff --git a/pgo/pgo.c b/pgo/pgo.c
index 2b7245d0..a9a89477 100644
--- a/pgo/pgo.c
+++ b/pgo/pgo.c
@@ -69,6 +69,12 @@ 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)
{
return true;
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;