mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-11 13:29:45 -05:00
surface: add WLR_SURFACE_STATE_OFFSET
This indicates whether the surface offset has changed.
This commit is contained in:
parent
98cf38601f
commit
42d68d7532
2 changed files with 8 additions and 5 deletions
|
|
@ -53,7 +53,8 @@ static void surface_handle_attach(struct wl_client *client,
|
|||
}
|
||||
}
|
||||
|
||||
surface->pending.committed |= WLR_SURFACE_STATE_BUFFER;
|
||||
surface->pending.committed |=
|
||||
WLR_SURFACE_STATE_BUFFER | WLR_SURFACE_STATE_OFFSET;
|
||||
surface->pending.dx = dx;
|
||||
surface->pending.dy = dy;
|
||||
|
||||
|
|
@ -279,11 +280,14 @@ static void surface_state_move(struct wlr_surface_state *state,
|
|||
if (next->committed & WLR_SURFACE_STATE_TRANSFORM) {
|
||||
state->transform = next->transform;
|
||||
}
|
||||
if (next->committed & WLR_SURFACE_STATE_BUFFER) {
|
||||
if (next->committed & WLR_SURFACE_STATE_OFFSET) {
|
||||
state->dx = next->dx;
|
||||
state->dy = next->dy;
|
||||
next->dx = next->dy = 0;
|
||||
|
||||
} else {
|
||||
state->dx = state->dy = 0;
|
||||
}
|
||||
if (next->committed & WLR_SURFACE_STATE_BUFFER) {
|
||||
wlr_buffer_unlock(state->buffer);
|
||||
state->buffer = NULL;
|
||||
if (next->buffer) {
|
||||
|
|
@ -291,8 +295,6 @@ static void surface_state_move(struct wlr_surface_state *state,
|
|||
}
|
||||
wlr_buffer_unlock(next->buffer);
|
||||
next->buffer = NULL;
|
||||
} else {
|
||||
state->dx = state->dy = 0;
|
||||
}
|
||||
if (next->committed & WLR_SURFACE_STATE_SURFACE_DAMAGE) {
|
||||
pixman_region32_copy(&state->surface_damage, &next->surface_damage);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue