Verified Commit 6a2a926a authored by Simon Ser's avatar Simon Ser

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]: wayland/wayland-protocols@962dd535Signed-off-by: Simon Ser's avatarSimon Ser <contact@emersion.fr>
parent 194ba387
Pipeline #57914 failed with stages
in 2 minutes and 3 seconds
...@@ -94,7 +94,7 @@ if test "x$GCC" = xyes ; then ...@@ -94,7 +94,7 @@ if test "x$GCC" = xyes ; then
fi fi
dnl Check for dtrace program (needed to build Xserver dtrace probes) dnl Check for dtrace program (needed to build Xserver dtrace probes)
dnl Also checks for <sys/sdt.h>, since some Linux distros have an dnl Also checks for <sys/sdt.h>, since some Linux distros have an
dnl ISDN trace program named dtrace dnl ISDN trace program named dtrace
AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH], AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
[Enable dtrace probes (default: enabled if dtrace found)]), [Enable dtrace probes (default: enabled if dtrace found)]),
...@@ -114,7 +114,7 @@ if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then ...@@ -114,7 +114,7 @@ if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
fi fi
fi fi
if test "x$WDTRACE" != "xno" ; then if test "x$WDTRACE" != "xno" ; then
AC_DEFINE(XSERVER_DTRACE, 1, AC_DEFINE(XSERVER_DTRACE, 1,
[Define to 1 if the DTrace Xserver provider probes should be built in.]) [Define to 1 if the DTrace Xserver provider probes should be built in.])
# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into # Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
...@@ -221,7 +221,7 @@ AC_CACHE_CHECK([for SYSV IPC], ...@@ -221,7 +221,7 @@ AC_CACHE_CHECK([for SYSV IPC],
#include <sys/shm.h> #include <sys/shm.h>
#include <sys/stat.h> #include <sys/stat.h>
]],[[ ]],[[
{ {
int id; int id;
id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR); id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
if (id < 0) return -1; if (id < 0) return -1;
...@@ -233,12 +233,12 @@ if test "x$ac_cv_sysv_ipc" = xyes; then ...@@ -233,12 +233,12 @@ if test "x$ac_cv_sysv_ipc" = xyes; then
AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available]) AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available])
fi fi
dnl OpenBSD /dev/xf86 aperture driver dnl OpenBSD /dev/xf86 aperture driver
if test -c /dev/xf86 ; then if test -c /dev/xf86 ; then
AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver]) AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver])
fi fi
dnl BSD APM support dnl BSD APM support
AC_CHECK_HEADER([machine/apmvar.h],[ AC_CHECK_HEADER([machine/apmvar.h],[
AC_CHECK_HEADER([sys/event.h], AC_CHECK_HEADER([sys/event.h],
ac_cv_BSD_KQUEUE_APM=yes, ac_cv_BSD_KQUEUE_APM=yes,
...@@ -246,7 +246,7 @@ AC_CHECK_HEADER([machine/apmvar.h],[ ...@@ -246,7 +246,7 @@ AC_CHECK_HEADER([machine/apmvar.h],[
AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes]) AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes])
AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes]) AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes])
dnl glibc backtrace support check dnl glibc backtrace support check
AC_CHECK_HEADER([execinfo.h],[ AC_CHECK_HEADER([execinfo.h],[
AC_CHECK_LIB(c, backtrace, [ AC_CHECK_LIB(c, backtrace, [
...@@ -284,7 +284,7 @@ case $host_cpu in ...@@ -284,7 +284,7 @@ case $host_cpu in
*netbsd*) AC_DEFINE(USE_I386_IOPL) *netbsd*) AC_DEFINE(USE_I386_IOPL)
SYS_LIBS=-li386 SYS_LIBS=-li386
;; ;;
*openbsd*) AC_DEFINE(USE_I386_IOPL) *openbsd*) AC_DEFINE(USE_I386_IOPL)
SYS_LIBS=-li386 SYS_LIBS=-li386
;; ;;
esac esac
...@@ -603,7 +603,7 @@ AC_ARG_ENABLE(xshmfence, AS_HELP_STRING([--disable-xshmfence], [Disable xsh ...@@ -603,7 +603,7 @@ AC_ARG_ENABLE(xshmfence, AS_HELP_STRING([--disable-xshmfence], [Disable xsh
dnl chown/chmod to be setuid root as part of build dnl chown/chmod to be setuid root as part of build
dnl Replaces InstallXserverSetUID in imake dnl Replaces InstallXserverSetUID in imake
AC_ARG_ENABLE(install-setuid, AC_ARG_ENABLE(install-setuid,
AS_HELP_STRING([--enable-install-setuid], AS_HELP_STRING([--enable-install-setuid],
[Install Xorg server as owned by root with setuid bit (default: auto)]), [Install Xorg server as owned by root with setuid bit (default: auto)]),
[SETUID=$enableval], [SETUID=auto]) [SETUID=$enableval], [SETUID=auto])
...@@ -685,7 +685,7 @@ case $host_os in ...@@ -685,7 +685,7 @@ case $host_os in
[xorg_cv_Carbon_framework=yes], [xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no]) [xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS]) LDFLAGS=$save_LDFLAGS])
if test "X$xorg_cv_Carbon_framework" = Xyes; then if test "X$xorg_cv_Carbon_framework" = Xyes; then
XQUARTZ=yes XQUARTZ=yes
else else
...@@ -1898,9 +1898,9 @@ if test "x$XORG" = xyes; then ...@@ -1898,9 +1898,9 @@ if test "x$XORG" = xyes; then
AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.]) AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.])
fi fi
AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"]) AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"])
case $host_cpu in case $host_cpu in
sparc*) sparc*)
SOLARIS_INOUT_ARCH="sparcv8plus" SOLARIS_INOUT_ARCH="sparcv8plus"
;; ;;
i*86|x86_64*) i*86|x86_64*)
...@@ -2266,13 +2266,13 @@ if test "$KDRIVE" = yes; then ...@@ -2266,13 +2266,13 @@ if test "$KDRIVE" = yes; then
# Xephyr needs nanosleep() which is in librt on Solaris # Xephyr needs nanosleep() which is in librt on Solaris
AC_CHECK_FUNC([nanosleep], [], AC_CHECK_FUNC([nanosleep], [],
AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt")) AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt"))
# damage shadow extension glx (NOTYET) fb mi # damage shadow extension glx (NOTYET) fb mi
KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src' KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src'
KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC"
KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux'
KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC"
KDRIVE_CFLAGS="$XSERVER_CFLAGS" KDRIVE_CFLAGS="$XSERVER_CFLAGS"
KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB"
...@@ -2297,7 +2297,7 @@ AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) ...@@ -2297,7 +2297,7 @@ AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
dnl Xwayland DDX 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 if test "x$XF86VIDMODE" = xyes; then
XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
fi fi
...@@ -2372,7 +2372,7 @@ AM_CONDITIONAL(XWAYLAND_EGLSTREAM, [test "x$XWAYLAND_EGLSTREAM" = "xyes"]) ...@@ -2372,7 +2372,7 @@ AM_CONDITIONAL(XWAYLAND_EGLSTREAM, [test "x$XWAYLAND_EGLSTREAM" = "xyes"])
dnl and the rest of these are generic, so they're in config.h dnl and the rest of these are generic, so they're in config.h
dnl dnl
dnl though, thanks to the passing of some significant amount of time, the dnl though, thanks to the passing of some significant amount of time, the
dnl above is probably a complete fallacy, and you should not rely on it. dnl above is probably a complete fallacy, and you should not rely on it.
dnl but this is still actually better than imake, honest. -daniels dnl but this is still actually better than imake, honest. -daniels
......
...@@ -308,9 +308,10 @@ output_handle_done(void *data, struct wl_output *wl_output) ...@@ -308,9 +308,10 @@ output_handle_done(void *data, struct wl_output *wl_output)
xwl_output->wl_output_done = TRUE; xwl_output->wl_output_done = TRUE;
/* Apply the changes from wl_output only if both "done" events are received, /* 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); apply_output_change(xwl_output);
} }
...@@ -352,14 +353,29 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) ...@@ -352,14 +353,29 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output)
struct xwl_output *xwl_output = data; struct xwl_output *xwl_output = data;
xwl_output->xdg_output_done = TRUE; 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); 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 = { static const struct zxdg_output_v1_listener xdg_output_listener = {
xdg_output_handle_logical_position, xdg_output_handle_logical_position,
xdg_output_handle_logical_size, xdg_output_handle_logical_size,
xdg_output_handle_done, xdg_output_handle_done,
xdg_output_handle_name,
xdg_output_handle_description,
}; };
struct xwl_output * struct xwl_output *
......
...@@ -807,8 +807,10 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, ...@@ -807,8 +807,10 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
xwl_screen->expecting_event++; xwl_screen->expecting_event++;
} }
else if (strcmp(interface, "zxdg_output_manager_v1") == 0) { 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 = 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); xwl_screen_init_xdg_output(xwl_screen);
} }
#ifdef XWL_HAS_GLAMOR #ifdef XWL_HAS_GLAMOR
......
...@@ -62,7 +62,7 @@ libdrm_req = '>= 2.4.89' ...@@ -62,7 +62,7 @@ libdrm_req = '>= 2.4.89'
libselinux_req = '>= 2.0.86' libselinux_req = '>= 2.0.86'
xext_req = '>= 1.0.99.4' xext_req = '>= 1.0.99.4'
wayland_req = '>= 1.3.0' wayland_req = '>= 1.3.0'
wayland_protocols_req = '>= 1.10' wayland_protocols_req = '>= 1.18'
gbm_req = '>= 10.2' gbm_req = '>= 10.2'
xf86dgaproto_req = '>= 2.0.99.1' xf86dgaproto_req = '>= 2.0.99.1'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment