mirror of
https://github.com/labwc/labwc.git
synced 2026-04-16 08:21:26 -04:00
osd-thumbnail: fix failed to get client texture
Use wlr_client_buffer->texture directly instead of wlr_texture_from_buffer. All buffers in content_tree are wlr_client_buffer. wlr_texture_from_buffer calls client_buffer_begin_data_ptr_access which fails when client_buffer->source == NULL (client released buffer early, e.g. wl_shm foot-terminal).
This commit is contained in:
parent
8b32422b93
commit
908264d5d7
1 changed files with 7 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <assert.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
#include <wlr/render/swapchain.h>
|
||||
#include <wlr/types/wlr_buffer.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
#include <wlr/types/wlr_scene.h>
|
||||
#include "config/rcxml.h"
|
||||
|
|
@ -46,8 +47,12 @@ render_node(struct wlr_render_pass *pass,
|
|||
if (!scene_buffer->buffer) {
|
||||
break;
|
||||
}
|
||||
struct wlr_texture *texture = wlr_texture_from_buffer(
|
||||
server.renderer, scene_buffer->buffer);
|
||||
struct wlr_texture *texture = NULL;
|
||||
struct wlr_client_buffer *client_buffer =
|
||||
wlr_client_buffer_get(scene_buffer->buffer);
|
||||
if (client_buffer) {
|
||||
texture = client_buffer->texture;
|
||||
}
|
||||
if (!texture) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -62,7 +67,6 @@ render_node(struct wlr_render_pass *pass,
|
|||
},
|
||||
.transform = scene_buffer->transform,
|
||||
});
|
||||
wlr_texture_destroy(texture);
|
||||
break;
|
||||
}
|
||||
case WLR_SCENE_NODE_RECT:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue