diff options
-rw-r--r-- | src/wayland/meta-wayland-surface.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index e8fb8fd08..d0ab61e65 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -1062,19 +1062,24 @@ wl_surface_attach (struct wl_client *client, } if (wl_resource_get_version (surface_resource) >= - WL_SURFACE_OFFSET_SINCE_VERSION && - (dx != 0 || dy != 0)) + WL_SURFACE_OFFSET_SINCE_VERSION) { - wl_resource_post_error (surface_resource, - WL_SURFACE_ERROR_INVALID_OFFSET, - "Attaching with an offset is no longer allowed"); - return; + if (dx != 0 || dy != 0) + { + wl_resource_post_error (surface_resource, + WL_SURFACE_ERROR_INVALID_OFFSET, + "Attaching with an offset is no longer allowed"); + return; + } + } + else + { + pending->dx = dx; + pending->dy = dy; } pending->newly_attached = TRUE; pending->buffer = buffer; - pending->dx = dx; - pending->dy = dy; if (buffer) { |