xserver: Branch 'server-1.20-branch' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 9 10:44:27 UTC 2020


 Xext/Makefile.am       |   10 ++++++++--
 configure.ac           |    5 +++++
 glx/Makefile.am        |    4 +++-
 hw/xwayland/xwayland.c |    7 ++++++-
 4 files changed, 22 insertions(+), 4 deletions(-)

New commits:
commit 5c400cae1f9817045378966effa6bca91e45aead
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Tue Oct 27 16:33:55 2020 +0100

    configure: Build hashtable for Xres and glvnd
    
    With autoconf, hashtable support is built along with Xres support.
    
    Yet, glvnd also use it, so when disabling Xres from configure, the
    build will fail at link time because hashtable functions are not
    available.
    
    Untie the build of hashtable from Xres support, just like meson build
    does.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1091
    (cherry picked from commit 899cebb76ab7754fea49f7babcd64a7e94052cc8)

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 32a27eba8..f15a15a3e 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -1,4 +1,4 @@
-noinst_LTLIBRARIES = libXext.la libXvidmode.la
+noinst_LTLIBRARIES = libXext.la libXvidmode.la libhashtable.la
 
 AM_CFLAGS = $(DIX_CFLAGS)
 
@@ -35,7 +35,7 @@ BUILTIN_SRCS  += $(XV_SRCS)
 endif
 
 # XResource extension: lets clients get data about per-client resource usage
-RES_SRCS = hashtable.c hashtable.h xres.c
+RES_SRCS = xres.c
 if RES
 BUILTIN_SRCS  += $(RES_SRCS)
 endif
@@ -95,10 +95,16 @@ endif
 
 libXext_la_SOURCES =		$(BUILTIN_SRCS)
 libXext_la_LIBADD =		$(BUILTIN_LIBS)
+if RES
+libXext_la_LIBADD += libhashtable.la
+endif
 
 # XVidMode extension
 libXvidmode_la_SOURCES = vidmode.c
 
+#Hashtable
+libhashtable_la_SOURCES = hashtable.c hashtable.h
+
 EXTRA_DIST = \
 	$(MITSHM_SRCS) \
 	$(XV_SRCS) \
diff --git a/configure.ac b/configure.ac
index b5eef76b2..b6a9145e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1064,9 +1064,11 @@ if test "x$SCREENSAVER" = xyes; then
 	SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $SCRNSAVERPROTO"
 fi
 
+HASHTABLE=no
 AM_CONDITIONAL(RES, [test "x$RES" = xyes])
 if test "x$RES" = xyes; then
 	AC_DEFINE(RES, 1, [Support X resource extension])
+	HASHTABLE=yes
 	REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO"
 	SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $RESOURCEPROTO"
 fi
@@ -1250,6 +1252,7 @@ if test "x$GLX" = xyes; then
 	PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
 	AC_SUBST(XLIB_CFLAGS)
 	AC_DEFINE(GLXEXT, 1, [Build GLX extension])
+	HASHTABLE=yes
 	GLX_LIBS='$(top_builddir)/glx/libglx.la $(top_builddir)/glx/libglxvnd.la'
 	GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS"
 else
@@ -1257,6 +1260,8 @@ else
 fi
 AM_CONDITIONAL(GLX, test "x$GLX" = xyes)
 
+AM_CONDITIONAL(HASHTABLE, test "x$HASHTABLE" = xyes)
+
 AC_SUBST([GLX_DEFINES])
 AC_SUBST([GLX_SYS_LIBS])
 
diff --git a/glx/Makefile.am b/glx/Makefile.am
index 0f652356d..8f19e9dc7 100644
--- a/glx/Makefile.am
+++ b/glx/Makefile.am
@@ -81,7 +81,7 @@ libglx_la_SOURCES = \
         unpack.h \
         xfont.c
 
-libglx_la_LIBADD = $(DLOPEN_LIBS)
+libglx_la_LIBADD = $(DLOPEN_LIBS) $(top_builddir)/Xext/libhashtable.la
 
 libglxvnd_la_SOURCES = \
 	vndcmds.c \
@@ -90,4 +90,6 @@ libglxvnd_la_SOURCES = \
 	vndservervendor.h \
 	vndservervendor.c
 
+libglxvnd_la_LIBADD = $(top_builddir)/Xext/libhashtable.la
+
 EXTRA_DIST = vnd_dispatch_stubs.c
commit 253569a3d281996d7c84041020e14313756900da
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Thu Nov 5 18:35:54 2020 +0100

    xwayland: Create an xwl_window for toplevel only
    
    One general assumption in Xwayland is that the xwl_window remains the
    same for all the child windows of the toplevel window.
    
    When mapping a new X11 window, ensure_surface_for_window() checks for an
    existing xwl_window by using xwl_window_get() which will just check for
    the registered xwl_window for the window.
    
    That means that a client mapping a child window of an existing window
    with a xwl_window will get another different xwl_window.
    
    If an X11 client issues a Present request on the parent window, hence
    placed underneath its child window of the same size, the Wayland
    compositor may not send the frame callback event for the parent's
    Wayland surface which is reckoned to be not visible, obscured behind
    the other Wayland surface for the child X11 window.
    
    That bug affects some games running in wine which may get 1 fps because
    the repaint occurs only on timeout with a long interval (as with, e.g.
    https://bugs.winehq.org/show_bug.cgi?id=47066)
    
    Fix ensure_surface_for_window() by using xwl_window_from_window() which
    will walk the window tree, so that a child window won't get another
    xwl_window than its parent.
    
    https://gitlab.freedesktop.org/xorg/xserver/-/issues/1099
    See-also: https://bugs.winehq.org/show_bug.cgi?id=47066
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
    (cherry picked from commit 606ba7fc51e5420646f75c4e672fbe61eb7c7e6e)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 21434c6e5..b353167c3 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -527,7 +527,7 @@ ensure_surface_for_window(WindowPtr window)
     struct xwl_window *xwl_window;
     struct wl_region *region;
 
-    if (xwl_window_get(window))
+    if (xwl_window_from_window(window))
         return TRUE;
 
     xwl_screen = xwl_screen_get(screen);
commit 0811a9ff783c252b3e4d558bf31c6b066b0633e1
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Nov 2 15:44:31 2020 +0100

    xwayland: non-rootless requires the wl_shell protocol
    
    When running non-rootless, Xwayland requires that the Wayland compositor
    supports the wl_shell protocol.
    
    Check for wl_shell protocol support at startup and exit cleanly if
    missing rather than segfaulting later in ensure_surface_for_window()
    while trying to use wl_shell_get_shell_surface().
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
    Reviewed-by: Simon Ser <contact at emersion.fr>
    (cherry picked from commit ffd02d9b26bd560849c407a6dd4f5c4d7d2c1736)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index a69188c0f..21434c6e5 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -1202,6 +1202,11 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
                              &registry_listener, xwl_screen);
     xwl_screen_roundtrip(xwl_screen);
 
+    if (!xwl_screen->rootless && !xwl_screen->shell) {
+        ErrorF("missing wl_shell protocol\n");
+        return FALSE;
+    }
+
     bpc = xwl_screen->depth / 3;
     green_bpc = xwl_screen->depth - 2 * bpc;
     blue_mask = (1 << bpc) - 1;


More information about the xorg-commit mailing list