xwayland: Pass the wl_output version
With the wl_output protocol, the actual bind to the interface is done in xwl_output_create(). Pass the version number from the registry so we can bind to the minimum version. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
parent
3c07a01c42
commit
b63ef10f18
|
@ -791,7 +791,8 @@ xwl_output_from_wl_output(struct xwl_screen *xwl_screen,
|
|||
}
|
||||
|
||||
struct xwl_output *
|
||||
xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id, Bool with_xrandr)
|
||||
xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id,
|
||||
Bool with_xrandr, uint32_t version)
|
||||
{
|
||||
struct xwl_output *xwl_output;
|
||||
char name[MAX_OUTPUT_NAME];
|
||||
|
@ -803,7 +804,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id, Bool with_xrandr)
|
|||
}
|
||||
|
||||
xwl_output->output = wl_registry_bind(xwl_screen->registry, id,
|
||||
&wl_output_interface, 2);
|
||||
&wl_output_interface, min(version, 2));
|
||||
if (!xwl_output->output) {
|
||||
ErrorF("Failed binding wl_output\n");
|
||||
goto err;
|
||||
|
|
|
@ -84,7 +84,8 @@ struct xwl_output *xwl_output_from_wl_output(struct xwl_screen *xwl_screen,
|
|||
struct wl_output* wl_output);
|
||||
|
||||
struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen,
|
||||
uint32_t id, Bool with_xrandr);
|
||||
uint32_t id, Bool with_xrandr,
|
||||
uint32_t version);
|
||||
|
||||
void xwl_output_destroy(struct xwl_output *xwl_output);
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
|
|||
NULL);
|
||||
}
|
||||
else if (strcmp(interface, "wl_output") == 0 && version >= 2) {
|
||||
if (xwl_output_create(xwl_screen, id, (xwl_screen->fixed_output == NULL)))
|
||||
if (xwl_output_create(xwl_screen, id, (xwl_screen->fixed_output == NULL), version))
|
||||
xwl_screen->expecting_event++;
|
||||
}
|
||||
else if (strcmp(interface, "zxdg_output_manager_v1") == 0) {
|
||||
|
|
Loading…
Reference in New Issue