mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 14:45:58 +01:00
output-layer: cache current state
The will be used by the Wayland backend to figure out whether updating sub-surface position is necessary.
This commit is contained in:
parent
59d2743c0c
commit
e00c4cd7dc
2 changed files with 12 additions and 2 deletions
|
@ -48,6 +48,10 @@ struct wlr_output_layer {
|
||||||
} events;
|
} events;
|
||||||
|
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
|
// private state
|
||||||
|
|
||||||
|
int x, y;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -842,11 +842,17 @@ bool wlr_output_commit_state(struct wlr_output *output,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pending.committed & WLR_OUTPUT_STATE_LAYERS) {
|
if (pending.committed & WLR_OUTPUT_STATE_LAYERS) {
|
||||||
// Commit layer ordering
|
|
||||||
for (size_t i = 0; i < pending.layers_len; i++) {
|
for (size_t i = 0; i < pending.layers_len; i++) {
|
||||||
struct wlr_output_layer *layer = pending.layers[i].layer;
|
struct wlr_output_layer_state *layer_state = &pending.layers[i];
|
||||||
|
struct wlr_output_layer *layer = layer_state->layer;
|
||||||
|
|
||||||
|
// Commit layer ordering
|
||||||
wl_list_remove(&layer->link);
|
wl_list_remove(&layer->link);
|
||||||
wl_list_insert(output->layers.prev, &layer->link);
|
wl_list_insert(output->layers.prev, &layer->link);
|
||||||
|
|
||||||
|
// Commit layer state
|
||||||
|
layer->x = layer_state->x;
|
||||||
|
layer->y = layer_state->y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue