mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
examples/output-layers: fix layers not included in commit
wlr_output_set_layers() attaches layers to the output's pending
state, but then uses a detached wlr_output_state in
wlr_output_state_commit(). This results in layers being left out
of the committed state.
Fixes: 8e81b4bb42
("examples: convert to new rendering API")
This commit is contained in:
parent
4339c37f99
commit
ac426c0c24
1 changed files with 6 additions and 4 deletions
|
@ -82,10 +82,13 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_output_set_layers(output->wlr_output, layers_arr.data,
|
struct wlr_output_state output_state = {
|
||||||
layers_arr.size / sizeof(struct wlr_output_layer_state));
|
.committed = WLR_OUTPUT_STATE_LAYERS,
|
||||||
|
.layers = layers_arr.data,
|
||||||
|
.layers_len = layers_arr.size / sizeof(struct wlr_output_layer_state),
|
||||||
|
};
|
||||||
|
|
||||||
if (!wlr_output_test(output->wlr_output)) {
|
if (!wlr_output_test_state(output->wlr_output, &output_state)) {
|
||||||
wlr_log(WLR_ERROR, "wlr_output_test() failed");
|
wlr_log(WLR_ERROR, "wlr_output_test() failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +96,6 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
|
||||||
int width, height;
|
int width, height;
|
||||||
wlr_output_effective_resolution(output->wlr_output, &width, &height);
|
wlr_output_effective_resolution(output->wlr_output, &width, &height);
|
||||||
|
|
||||||
struct wlr_output_state output_state = {0};
|
|
||||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &output_state,
|
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &output_state,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue