diff options
| -rw-r--r-- | wayland.c | 10 | ||||
| -rw-r--r-- | wayland.h | 1 |
2 files changed, 11 insertions, 0 deletions
@@ -801,11 +801,19 @@ wayl_cursor_set(struct wayland *wayl, const struct terminal *term) if (wayl->pointer.theme == NULL) return false; + if (wayl->moused == NULL) { + wayl->pointer.xcursor = NULL; + return true; + } + if (wayl->moused != term) { /* This terminal doesn't have mouse focus */ return true; } + if (wayl->pointer.xcursor == term->xcursor) + return true; + wayl->pointer.cursor = wl_cursor_theme_get_cursor(wayl->pointer.theme, term->xcursor); if (wayl->pointer.cursor == NULL) { LOG_ERR("%s: failed to load xcursor pointer '%s'", @@ -813,6 +821,8 @@ wayl_cursor_set(struct wayland *wayl, const struct terminal *term) return false; } + wayl->pointer.xcursor = term->xcursor; + const int scale = term->scale; struct wl_cursor_image *image = wayl->pointer.cursor->images[0]; @@ -132,6 +132,7 @@ struct wayland { struct wl_cursor *cursor; int size; char *theme_name; + const char *xcursor; } pointer; struct { |
