aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/multi-pointer.c2
-rw-r--r--examples/pointer.c2
-rw-r--r--rootston/output.c2
-rw-r--r--types/wlr_output.c8
4 files changed, 5 insertions, 9 deletions
diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c
index 3cfa3910..e1ac2734 100644
--- a/examples/multi-pointer.c
+++ b/examples/multi-pointer.c
@@ -84,8 +84,6 @@ static void handle_output_add(struct output_state *ostate) {
example_config_configure_cursor(sample->config, cursor->cursor,
sample->compositor);
- // TODO the cursor must be set depending on which surface it is
- // displayed over which should happen in the compositor.
struct wlr_xcursor_image *image = sample->xcursor->images[0];
wlr_cursor_set_image(cursor->cursor, image->buffer, image->width,
image->width, image->height, image->hotspot_x, image->hotspot_y);
diff --git a/examples/pointer.c b/examples/pointer.c
index 83122421..8927314e 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -108,8 +108,6 @@ static void handle_output_add(struct output_state *ostate) {
example_config_configure_cursor(sample->config, sample->cursor,
sample->compositor);
- // TODO the cursor must be set depending on which surface it is displayed
- // over which should happen in the compositor.
struct wlr_xcursor_image *image = sample->xcursor->images[0];
wlr_cursor_set_image(sample->cursor, image->buffer, image->width,
image->width, image->height, image->hotspot_x, image->hotspot_y);
diff --git a/rootston/output.c b/rootston/output.c
index 6ca302d8..9e1cd4d5 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -223,8 +223,6 @@ void output_add_notify(struct wl_listener *listener, void *data) {
cursor_load_config(config, input->cursor, input, desktop);
- // TODO the cursor must be set depending on which surface it is displayed
- // over which should happen in the compositor.
struct wlr_xcursor *xcursor = get_default_xcursor(input->xcursor_theme);
struct wlr_xcursor_image *image = xcursor->images[0];
wlr_cursor_set_image(input->cursor, image->buffer, image->width,
diff --git a/types/wlr_output.c b/types/wlr_output.c
index 3cdeecfe..3804f2e3 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -241,13 +241,15 @@ static void output_cursor_render(struct wlr_output_cursor *cursor) {
struct wlr_texture *texture = cursor->texture;
struct wlr_renderer *renderer = cursor->renderer;
if (cursor->surface != NULL) {
+ // Some clients commit a cursor surface with a NULL buffer to hide it.
+ if (!wlr_surface_has_buffer(cursor->surface)) {
+ return;
+ }
texture = cursor->surface->texture;
renderer = cursor->surface->renderer;
}
- // We check texture->valid because some clients set a cursor surface
- // with a NULL buffer to hide it
- if (renderer && texture && texture->valid) {
+ if (texture != NULL && renderer != NULL) {
glViewport(0, 0, cursor->output->width, cursor->output->height);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);