Skip to content

Commit 3948b27

Browse files
authored
Bump wl_compositor to version 5 (#734)
1 parent 76ad6af commit 3948b27

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ udev_req = '>= 228'
3737
gudev_req = '>= 232'
3838

3939
# wayland version requirements
40-
wayland_server_req = '>= 1.13.0'
40+
wayland_server_req = '>= 1.20'
4141
wayland_protocols_req = '>= 1.19'
4242

4343
# native backend version requirements

src/wayland/meta-wayland-surface.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,11 @@ meta_wayland_surface_state_merge_into (MetaWaylandSurfaceState *from,
468468

469469
to->newly_attached = TRUE;
470470
to->buffer = from->buffer;
471-
to->dx = from->dx;
472-
to->dy = from->dy;
473471
}
474472

473+
to->dx = from->dx;
474+
to->dy = from->dy;
475+
475476
wl_list_insert_list (&to->frame_callback_list, &from->frame_callback_list);
476477

477478
cairo_region_union (to->surface_damage, from->surface_damage);
@@ -925,6 +926,16 @@ wl_surface_attach (struct wl_client *client,
925926
pending->buffer);
926927
}
927928

929+
if (wl_resource_get_version (surface_resource) >=
930+
WL_SURFACE_OFFSET_SINCE_VERSION &&
931+
(dx != 0 || dy != 0))
932+
{
933+
wl_resource_post_error (surface_resource,
934+
WL_SURFACE_ERROR_INVALID_OFFSET,
935+
"Attaching with an offset is no longer allowed");
936+
return;
937+
}
938+
928939
pending->newly_attached = TRUE;
929940
pending->buffer = buffer;
930941
pending->dx = dx;
@@ -1153,6 +1164,20 @@ wl_surface_damage_buffer (struct wl_client *client,
11531164
cairo_region_union_rectangle (pending->buffer_damage, &rectangle);
11541165
}
11551166

1167+
static void
1168+
wl_surface_offset (struct wl_client *client,
1169+
struct wl_resource *surface_resource,
1170+
int32_t dx,
1171+
int32_t dy)
1172+
{
1173+
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
1174+
MetaWaylandSurfaceState *pending = surface->pending_state;
1175+
1176+
pending->dx = dx;
1177+
pending->dy = dy;
1178+
}
1179+
1180+
11561181
static const struct wl_surface_interface meta_wayland_wl_surface_interface = {
11571182
wl_surface_destroy,
11581183
wl_surface_attach,
@@ -1164,6 +1189,7 @@ static const struct wl_surface_interface meta_wayland_wl_surface_interface = {
11641189
wl_surface_set_buffer_transform,
11651190
wl_surface_set_buffer_scale,
11661191
wl_surface_damage_buffer,
1192+
wl_surface_offset,
11671193
};
11681194

11691195
static void

src/wayland/meta-wayland-versions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/* #define META_WL_BUFFER_VERSION 1 */
3636

3737
/* Global/master objects (version exported by wl_registry and negotiated through bind) */
38-
#define META_WL_COMPOSITOR_VERSION 4
38+
#define META_WL_COMPOSITOR_VERSION 5
3939
#define META_WL_DATA_DEVICE_MANAGER_VERSION 3
4040
#define META_XDG_WM_BASE_VERSION 3
4141
#define META_WL_SEAT_VERSION 5

0 commit comments

Comments
 (0)