xserver: Branch 'xwayland-23.2' - 5 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 29 13:20:58 UTC 2023


 hw/xwayland/xwayland-output.c |   10 ++++++++++
 hw/xwayland/xwayland-types.h  |    1 +
 hw/xwayland/xwayland-window.c |   30 ++++++++++++++++++++++++++++--
 hw/xwayland/xwayland-window.h |    3 ++-
 meson.build                   |    5 ++++-
 meson_options.txt             |    2 ++
 6 files changed, 47 insertions(+), 4 deletions(-)

New commits:
commit 7883646a8f208a1db4cb98f8b295c7f862da3b2a
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Fri Nov 17 11:54:54 2023 +0100

    build: Allow for custom server config directory
    
    Most X servers, even those which do not have specific configuration
    files, can use the directory specified by SERVER_MISC_CONFIG_PATH when
    they have either the XSECURITY or XSELINUX extensions enabled, or when
    support for DTRACE is enabled at build time, because this is also where
    the "protocol.txt" file is searched for at runtime.
    
    Unfortunately, the SERVER_MISC_CONFIG_PATH is set from serverconfigdir
    which is hardcoded in the build system to "$prefix/$libdir/xorg", and
    all X server builds share the same path.
    
    That makes it harder for different X servers such as Xwayland to install
    in the same path without sharing the same server configuration path
    (and hence the same "protocol.txt" file).
    
    Allow for the customization of server configuration path from the build
    options so that different X servers can use completely different and
    independent paths.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 411a61f571aa1dde54d52b0200a4e1a9d0def336)

diff --git a/meson.build b/meson.build
index fcf808c64..3be2bcd7f 100644
--- a/meson.build
+++ b/meson.build
@@ -476,7 +476,10 @@ glx_inc = include_directories('glx')
 
 top_dir_inc = include_directories('.')
 
-serverconfigdir = join_paths(get_option('prefix'), get_option('libdir'), 'xorg')
+serverconfigdir = get_option('serverconfigdir')
+if serverconfigdir == ''
+    serverconfigdir = join_paths(get_option('prefix'), get_option('libdir'), 'xorg')
+endif
 
 manpage_config = configuration_data()
 manpage_config.set('vendorversion', '"xorg-server @0@" "X Version 11"'.format(meson.project_version()))
diff --git a/meson_options.txt b/meson_options.txt
index 1d0de5206..af094df70 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -14,6 +14,8 @@ option('builder_string', type: 'string', description: 'Additional builder string
 option('default_font_path', type: 'string')
 option('fontrootdir', type: 'string',
         description: 'Root directory for legacy fonts. Default: from font-utils.pc or $datadir/fonts/X11')
+option('serverconfigdir', type: 'string',
+        description: 'Miscellaneous server configuration files path. Default: $libdir/xorg')
 
 option('glx', type: 'boolean', value: true)
 option('xdmcp', type: 'boolean', value: true)
commit 074c2a1e502e3139a6e9d90941c19b9b80d22226
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Thu Nov 9 10:40:53 2023 +0100

    xwayland: Do not resize when running fullscreen
    
    When running fullscreen, if an X11 client has changed the resolution,
    Xwayland is using a viewport to emulate the expected resolution.
    
    When changing focus, the Wayland compositor will send a configure event
    with the actual surface size, not the size of the emulated XRandR
    resolution.
    
    As a result, changing focus while XRandR emulation (and hence the
    viewport) is active in Xwayland will revert the resolution to the actual
    output size, defeating the XRandR emulation.
    
    To avoid that issue, only change the size when not running fullscreen.
    
    Fixes: 53b6d4db7 - xwayland: Apply root toplevel configure dimensions
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Kenny Levinsen <kl at kl.wtf>
    (cherry picked from commit a797776ff29e67b5dd60aebf3cef144a743d3cb4)

diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index 92ec4995c..4978f37c7 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -789,13 +789,16 @@ xdg_toplevel_handle_configure(void *data,
                               struct wl_array *states)
 {
     struct xwl_window *xwl_window = data;
+    struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
 
     /* Maintain our current size if no dimensions are requested */
     if (width == 0 && height == 0)
         return;
 
-    /* This will be committed by the xdg_surface.configure handler */
-    xwl_window_maybe_resize(xwl_window, width, height);
+    if (!xwl_screen->fullscreen) {
+        /* This will be committed by the xdg_surface.configure handler */
+        xwl_window_maybe_resize(xwl_window, width, height);
+    }
 }
 
 static void
commit 654fca9c31d0b981a5c847ed4e61379ec1dcb7b1
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Fri Nov 10 09:17:20 2023 +0100

    xwayland: Update the fullscreen window on output change
    
    Make sure to update the fullscreen rootful window configuration whenever
    the output setup changes.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Kenny Levinsen <kl at kl.wtf>
    (cherry picked from commit 06eb7271a92fb677837811d42452d38d6fb68f25)

diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index fe7a9232e..f26fb5a4f 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -601,6 +601,7 @@ static void
 apply_output_change(struct xwl_output *xwl_output)
 {
     struct xwl_screen *xwl_screen = xwl_output->xwl_screen;
+    struct xwl_window *xwl_window;
     struct xwl_output *it;
     int mode_width, mode_height, count;
     int width = 0, height = 0, has_this_output = 0;
@@ -658,6 +659,15 @@ apply_output_change(struct xwl_output *xwl_output)
         update_screen_size(xwl_screen, width, height);
     else
         RRTellChanged(xwl_screen->screen);
+
+    /* If running rootful and fullscreen, make sure to match the new setup */
+    if (xwl_screen->fullscreen) {
+        /* The root window may not yet be created */
+        if (xwl_screen->screen->root) {
+            xwl_window = xwl_window_get(xwl_screen->screen->root);
+            xwl_window_rootful_update_fullscreen(xwl_window, xwl_output);
+        }
+    }
 }
 
 static void
commit 8046b0c222bbf4db1e4804e04e1ec321ae427bbf
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Fri Nov 10 09:08:57 2023 +0100

    xwayland: Add a helper function to update fullscreen
    
    Whenever the output configuration changes, if Xwayland is running
    fullscreen, we may need to update the viewport in use or even update the
    output on which Xwayland is currently running fullscreen.
    
    Add a new helper function xwl_window_rootful_update_fullscreen() that
    will recompute the fullscreen state and the viewport setup so that the
    fullscreen Xwayland rootful window matches the new setup.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Kenny Levinsen <kl at kl.wtf>
    (cherry picked from commit 73b9ff53c39a56c8d84a20214e9f8da162d56059)

diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index a4f02a058..92ec4995c 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -569,6 +569,29 @@ xwl_window_set_fullscreen(struct xwl_window *xwl_window)
     return TRUE;
 }
 
+void
+xwl_window_rootful_update_fullscreen(struct xwl_window *xwl_window,
+                                     struct xwl_output *xwl_output)
+{
+    struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
+
+    if (!xwl_screen->fullscreen)
+        return;
+
+    if (xwl_window->window != xwl_screen->screen->root)
+        return;
+
+    if (xwl_window->wl_output_fullscreen != xwl_output->output)
+        return;
+
+    /* The size and position of the output may have changed, clear our
+     * output to make sure the next call to xwl_window_set_fullscreen()
+     * recomputes the size and updates the viewport as needed.
+     */
+    xwl_window->wl_output_fullscreen = NULL;
+    xwl_window_set_fullscreen(xwl_window);
+}
+
 void
 xwl_window_rootful_update_title(struct xwl_window *xwl_window)
 {
diff --git a/hw/xwayland/xwayland-window.h b/hw/xwayland/xwayland-window.h
index 45ae16da0..7fbb2a623 100644
--- a/hw/xwayland/xwayland-window.h
+++ b/hw/xwayland/xwayland-window.h
@@ -135,7 +135,8 @@ Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window);
 Bool xwl_window_is_toplevel(WindowPtr window);
 void xwl_window_check_resolution_change_emulation(struct xwl_window *xwl_window);
 void xwl_window_rootful_update_title(struct xwl_window *xwl_window);
-
+void xwl_window_rootful_update_fullscreen(struct xwl_window *xwl_window,
+                                          struct xwl_output *xwl_output);
 void xwl_window_set_window_pixmap(WindowPtr window, PixmapPtr pixmap);
 
 Bool xwl_realize_window(WindowPtr window);
commit 89d237c593d7c0cb7c49141efef9a283880974da
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Fri Nov 10 09:06:35 2023 +0100

    xwayland: Add xwl_output to the Xwayland types
    
    No functional change.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Kenny Levinsen <kl at kl.wtf>
    (cherry picked from commit 2f84e3fe0d1bb22a44c8a4a9eb4c9bd92f66b1a3)

diff --git a/hw/xwayland/xwayland-types.h b/hw/xwayland/xwayland-types.h
index e70e56320..927a07168 100644
--- a/hw/xwayland/xwayland-types.h
+++ b/hw/xwayland/xwayland-types.h
@@ -31,5 +31,6 @@ struct xwl_window;
 struct xwl_screen;
 struct xwl_egl_backend;
 struct xwl_drm_lease;
+struct xwl_output;
 
 #endif /* XWAYLAND_TYPES_H */


More information about the xorg-commit mailing list