aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'render.c')
-rw-r--r--render.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/render.c b/render.c
index 4f0d2348..3ce8a226 100644
--- a/render.c
+++ b/render.c
@@ -4363,8 +4363,6 @@ render_xcursor_update(struct seat *seat)
return;
}
- xassert(seat->pointer.cursor != NULL);
-
const enum cursor_shape shape = seat->pointer.shape;
const char *const xcursor = seat->pointer.last_custom_xcursor;
@@ -4398,6 +4396,23 @@ render_xcursor_update(struct seat *seat)
LOG_DBG("setting %scursor shape using a client-side cursor surface",
seat->pointer.shape == CURSOR_SHAPE_CUSTOM ? "custom " : "");
+ if (seat->pointer.cursor == NULL) {
+ /*
+ * Normally, we never get here with a NULL-cursor, because we
+ * only schedule a cursor update when we succeed to load the
+ * cursor image.
+ *
+ * However, it is possible that we did succeed to load an
+ * image, and scheduled an update. But, *before* the scheduled
+ * update triggers, the user mvoes the pointer, and we try to
+ * load a new cursor image. This time failing.
+ *
+ * In this case, we have a NULL cursor, but the scheduled
+ * update is still scheduled.
+ */
+ return;
+ }
+
const float scale = seat->pointer.scale;
struct wl_cursor_image *image = seat->pointer.cursor->images[0];
struct wl_buffer *buf = wl_cursor_image_get_buffer(image);