diff options
author | Simon Ser <contact@emersion.fr> | 2021-07-07 17:36:36 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-07-07 12:02:24 -0400 |
commit | a48e569d3860e91428c74e876a5d886314767c7b (patch) | |
tree | f022c5fdf2a241472e0c166b60f161c777be3b01 | |
parent | c2bd63c1865358ec22e467dad70159dac0afbed9 (diff) |
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.
-rw-r--r-- | types/wlr_output_damage.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/types/wlr_output_damage.c b/types/wlr_output_damage.c index b0655a65..e49df016 100644 --- a/types/wlr_output_damage.c +++ b/types/wlr_output_damage.c @@ -52,7 +52,11 @@ static void output_handle_precommit(struct wl_listener *listener, void *data) { if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) { // TODO: find a better way to access this info without a precommit // handler - output_damage->pending_buffer_type = output->pending.buffer_type; + 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; + } } } |