output-damage: fix output swapchain handling
When wlr_output.swapchain is used instead of the backend's, the
buffer_type will be set to SCANOUT even if wlr_output_attach_render
has been called. This tricks wlr_output_damage into thinking the
whole output needs to be repainted.
Workaround this issue by forcing buffer_type to RENDER when the
output has a back-buffer set.
Will clean all of that up when removing the precommit event handler
altogether.
This commit fixes damage tracking on the Wayland, X11 and headless
backends.
(cherry picked from commit a48e569d38
)
This commit is contained in:
parent
2a6dc0059f
commit
6d742464bb
|
@ -52,9 +52,13 @@ static void output_handle_precommit(struct wl_listener *listener, void *data) {
|
||||||
if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
|
if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
|
||||||
// TODO: find a better way to access this info without a precommit
|
// TODO: find a better way to access this info without a precommit
|
||||||
// handler
|
// handler
|
||||||
|
if (output->back_buffer != NULL) {
|
||||||
|
output_damage->pending_buffer_type = WLR_OUTPUT_STATE_BUFFER_RENDER;
|
||||||
|
} else {
|
||||||
output_damage->pending_buffer_type = output->pending.buffer_type;
|
output_damage->pending_buffer_type = output->pending.buffer_type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void output_handle_commit(struct wl_listener *listener, void *data) {
|
static void output_handle_commit(struct wl_listener *listener, void *data) {
|
||||||
struct wlr_output_damage *output_damage =
|
struct wlr_output_damage *output_damage =
|
||||||
|
|
Loading…
Reference in New Issue