diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-09-19 05:18:31 -0400 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-10-02 06:08:10 +0000 |
commit | c044aef5f0c0fae57e6354b64a59481824c59c3e (patch) | |
tree | 9d190a246325e845d670ddf66c35a3785112e67e | |
parent | 7ef2c0a506046b029ab105eb7b2b190fe175228a (diff) |
cursor: Unset cursor if texture upload failed
We need to make sure cursor_output_cursor_update() will clear the old
texture references through all code paths.
-rw-r--r-- | types/wlr_cursor.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index 108d95dc..fb16c6cd 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -505,17 +505,15 @@ static void cursor_output_cursor_update(struct wlr_cursor_output_cursor *output_ int dst_width = 0, dst_height = 0; if (buffer != NULL) { texture = wlr_texture_from_buffer(renderer, buffer); - if (texture == NULL) { - return; + if (texture) { + src_box = (struct wlr_fbox){ + .width = texture->width, + .height = texture->height, + }; + + dst_width = texture->width / scale; + dst_height = texture->height / scale; } - - src_box = (struct wlr_fbox){ - .width = texture->width, - .height = texture->height, - }; - - dst_width = texture->width / scale; - dst_height = texture->height / scale; } output_cursor_set_texture(output_cursor->output_cursor, texture, true, |