xwayland: add support for xdg-output-unstable-v1 version 3
This adds support for xdg-output-unstable-v1 version 3, added in [1].
This new version deprecates zxdg_output_v1.done and replaces it with
wl_output.done. If the version is high enough, there's no need to wait for both
an xdg_output.done event and a wl_output.done event -- we only care about
wl_output.done.
[1]: 962dd53537
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
parent
f0d78b47ac
commit
01ed478c65
|
@ -2297,7 +2297,7 @@ AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
|
|||
|
||||
dnl Xwayland DDX
|
||||
|
||||
XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.10"
|
||||
XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.18"
|
||||
if test "x$XF86VIDMODE" = xyes; then
|
||||
XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
|
||||
fi
|
||||
|
|
|
@ -308,9 +308,10 @@ output_handle_done(void *data, struct wl_output *wl_output)
|
|||
|
||||
xwl_output->wl_output_done = TRUE;
|
||||
/* Apply the changes from wl_output only if both "done" events are received,
|
||||
* or if xdg-output is not supported.
|
||||
* if xdg-output is not supported or if xdg-output version is high enough.
|
||||
*/
|
||||
if (xwl_output->xdg_output_done || !xwl_output->xdg_output)
|
||||
if (xwl_output->xdg_output_done || !xwl_output->xdg_output ||
|
||||
zxdg_output_v1_get_version(xwl_output->xdg_output) >= 3)
|
||||
apply_output_change(xwl_output);
|
||||
}
|
||||
|
||||
|
@ -352,14 +353,29 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output)
|
|||
struct xwl_output *xwl_output = data;
|
||||
|
||||
xwl_output->xdg_output_done = TRUE;
|
||||
if (xwl_output->wl_output_done)
|
||||
if (xwl_output->wl_output_done &&
|
||||
zxdg_output_v1_get_version(xdg_output) < 3)
|
||||
apply_output_change(xwl_output);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_output_handle_name(void *data, struct zxdg_output_v1 *xdg_output,
|
||||
const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_output_handle_description(void *data, struct zxdg_output_v1 *xdg_output,
|
||||
const char *description)
|
||||
{
|
||||
}
|
||||
|
||||
static const struct zxdg_output_v1_listener xdg_output_listener = {
|
||||
xdg_output_handle_logical_position,
|
||||
xdg_output_handle_logical_size,
|
||||
xdg_output_handle_done,
|
||||
xdg_output_handle_name,
|
||||
xdg_output_handle_description,
|
||||
};
|
||||
|
||||
struct xwl_output *
|
||||
|
|
|
@ -807,8 +807,10 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
|
|||
xwl_screen->expecting_event++;
|
||||
}
|
||||
else if (strcmp(interface, "zxdg_output_manager_v1") == 0) {
|
||||
/* We support xdg-output from version 1 to version 3 */
|
||||
version = min(version, 3);
|
||||
xwl_screen->xdg_output_manager =
|
||||
wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1);
|
||||
wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, version);
|
||||
xwl_screen_init_xdg_output(xwl_screen);
|
||||
}
|
||||
#ifdef XWL_HAS_GLAMOR
|
||||
|
|
|
@ -62,7 +62,7 @@ libdrm_req = '>= 2.4.89'
|
|||
libselinux_req = '>= 2.0.86'
|
||||
xext_req = '>= 1.0.99.4'
|
||||
wayland_req = '>= 1.3.0'
|
||||
wayland_protocols_req = '>= 1.10'
|
||||
wayland_protocols_req = '>= 1.18'
|
||||
gbm_req = '>= 10.2'
|
||||
xf86dgaproto_req = '>= 2.0.99.1'
|
||||
|
||||
|
|
Loading…
Reference in New Issue