diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2023-02-07 15:05:34 +0100 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2023-02-13 14:41:05 +0100 |
commit | b63ef10f188936506e8050015d3654aa324f6e43 (patch) | |
tree | 2dae3917da484d51abf2cec87bdb24f2f62b5c9a | |
parent | 3c07a01c42d56c882bde33b7456c367781fabfee (diff) | |
download | xserver-b63ef10f188936506e8050015d3654aa324f6e43.tar.gz |
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>
-rw-r--r-- | hw/xwayland/xwayland-output.c | 5 | ||||
-rw-r--r-- | hw/xwayland/xwayland-output.h | 3 | ||||
-rw-r--r-- | hw/xwayland/xwayland-screen.c | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 8e387e760..f864f5ba5 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -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; diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h index e975dfbf6..a95288e4f 100644 --- a/hw/xwayland/xwayland-output.h +++ b/hw/xwayland/xwayland-output.h @@ -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); diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index 94085af34..46ab4fed7 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -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) { |