xserver: Branch 'master' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 2 09:01:06 UTC 2024


 .gitlab-ci.yml                |    2 +-
 .gitlab-ci/debian-install.sh  |    4 ++--
 hw/xwayland/meson.build       |    2 ++
 hw/xwayland/xwayland-input.c  |   34 ++++++++++++++++++++++++++++++++++
 hw/xwayland/xwayland-screen.h |    1 +
 meson.build                   |    2 +-
 6 files changed, 41 insertions(+), 4 deletions(-)

New commits:
commit e4804d11e8fab4b7ac691d0458d6608a4955d9e0
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Thu Nov 14 17:19:08 2024 +0100

    xwayland: Add xdg-system-bell support
    
    For the Wayland compositors who do not implement XkbBellNotifyMask but
    support the Wayland protocol xdg-system-bell, use that to ring the
    bell.
    
    v2: Be more selective on the device, make sure it's a keyboard and it
        has core events.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1742>

diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build
index 0ccb32a75..9616aae01 100644
--- a/hw/xwayland/meson.build
+++ b/hw/xwayland/meson.build
@@ -51,6 +51,7 @@ xwayland_shell_xml = join_paths(protodir, 'staging', 'xwayland-shell', 'xwayland
 tearing_xml = join_paths(protodir, 'staging', 'tearing-control', 'tearing-control-v1.xml')
 fractional_scale_xml = join_paths(protodir, 'staging', 'fractional-scale', 'fractional-scale-v1.xml')
 syncobj_xml = join_paths(protodir, 'staging', 'linux-drm-syncobj', 'linux-drm-syncobj-v1.xml')
+system_bell_xml = join_paths(protodir, 'staging', 'xdg-system-bell', 'xdg-system-bell-v1.xml')
 
 proto_xml = [
     relative_xml,
@@ -68,6 +69,7 @@ proto_xml = [
     tearing_xml,
     fractional_scale_xml,
     syncobj_xml,
+    system_bell_xml,
 ]
 
 client_header = generator(scanner,
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 7f1c2619a..ac67d478e 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -57,6 +57,7 @@
 #include "pointer-gestures-unstable-v1-client-protocol.h"
 #include "xwayland-keyboard-grab-unstable-v1-client-protocol.h"
 #include "keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h"
+#include "xdg-system-bell-v1-client-protocol.h"
 
 #define SCROLL_AXIS_HORIZ 2
 #define SCROLL_AXIS_VERT 3
@@ -3091,6 +3092,15 @@ init_keyboard_shortcuts_inhibit(struct xwl_screen *xwl_screen,
                           1);
 }
 
+static void
+init_system_bell(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version)
+{
+     xwl_screen->system_bell =
+         wl_registry_bind(xwl_screen->registry, id,
+                          &xdg_system_bell_v1_interface,
+                          1);
+}
+
 /* The compositor may send us wl_seat and its capabilities before sending e.g.
    relative_pointer_manager or pointer_gesture interfaces. This would result in
    devices being created in capabilities handler, but listeners not, because
@@ -3142,6 +3152,8 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id,
         init_keyboard_grab(xwl_screen, id, version);
     } else if (strcmp(interface, zwp_keyboard_shortcuts_inhibit_manager_v1_interface.name) == 0) {
         init_keyboard_shortcuts_inhibit(xwl_screen, id, version);
+    } else if (strcmp(interface, xdg_system_bell_v1_interface.name) == 0) {
+        init_system_bell(xwl_screen, id, version);
     }
 }
 
@@ -3164,6 +3176,28 @@ ProcessInputEvents(void)
 void
 DDXRingBell(int volume, int pitch, int duration)
 {
+    ScreenPtr screen = screenInfo.screens[0];
+    struct xwl_screen *xwl_screen;
+    struct xwl_seat *xwl_seat;
+
+    xwl_screen = xwl_screen_get(screen);
+    if (!xwl_screen->system_bell)
+        return;
+
+    xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) {
+        if (!xwl_seat->keyboard)
+            continue;
+
+        if (!xwl_seat->keyboard->coreEvents)
+            continue;
+
+        if (!xwl_seat->keyboard_focus)
+            continue;
+
+        DebugF("XWAYLAND: Ringing the bell\n");
+        xdg_system_bell_v1_ring (xwl_screen->system_bell, xwl_seat->keyboard_focus);
+        return;
+    }
 }
 
 static Bool
diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h
index 0800fb392..49a167a12 100644
--- a/hw/xwayland/xwayland-screen.h
+++ b/hw/xwayland/xwayland-screen.h
@@ -117,6 +117,7 @@ struct xwl_screen {
     struct wp_tearing_control_manager_v1 *tearing_control_manager;
     struct wp_fractional_scale_manager_v1 *fractional_scale_manager;
     struct wp_linux_drm_syncobj_manager_v1 *explicit_sync;
+    struct xdg_system_bell_v1 *system_bell;
     struct xorg_list drm_lease_devices;
     struct xorg_list queued_drm_lease_devices;
     struct xorg_list drm_leases;
commit 1ccc19d1dfc1118551115dd1eefd49400afed2d7
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Thu Nov 14 16:39:42 2024 +0100

    build: Bump wayland-protocols requirement to 1.38
    
    To get xdg-system-bell-v1 protocol.
    
    This is just preparation work for the next commits.
    
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1742>

diff --git a/meson.build b/meson.build
index 35f84ff07..e95743ff9 100644
--- a/meson.build
+++ b/meson.build
@@ -65,7 +65,7 @@ libselinux_req = '>= 2.0.86'
 xext_req = '>= 1.0.99.4'
 xproto_req = '>= 7.0.31'
 wayland_req = '>= 1.21.0'
-wayland_protocols_req = '>= 1.34'
+wayland_protocols_req = '>= 1.38'
 gbm_req = '>= 10.2'
 xf86dgaproto_req = '>= 2.0.99.1'
 xshmfence_req = '>= 1.1'
commit a55ed3309bc57d8328283d2a65b89f1e58d92bf7
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Thu Nov 14 17:33:21 2024 +0100

    ci: Install wayland-protocols 1.38
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1742>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 48fca7a9c..ab17016d6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,7 +21,7 @@ variables:
     REPO_URL_XORGPROTO:   'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
     XORG_DEBIAN_VERSION:  'bullseye-slim'
     XORG_DEBIAN_EXEC:     'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
-    XORG_DEBIAN_TAG:      '2024-09-09-meson-backport'
+    XORG_DEBIAN_TAG:      '2024-11-14-wayland-protocols-1-38'
     XORG_FREEBSD_VERSION: '14.0'
     XORG_FREEBSD_EXEC:    ''
     XORG_FREEBSD_TAG:     '2024-06-10.0'
diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh
index 81cb4cb62..f68ad3311 100644
--- a/.gitlab-ci/debian-install.sh
+++ b/.gitlab-ci/debian-install.sh
@@ -151,8 +151,8 @@ ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
 cd ..
 rm -rf wayland
 
-# Xwayland requires wayland-protocols >= 1.34, but Debian bullseye has 1.20 only
-git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.34
+# Xwayland requires wayland-protocols >= 1.38, but Debian bullseye has 1.20 only
+git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.38
 cd wayland-protocols
 meson _build
 ninja -C _build -j${FDO_CI_CONCURRENT:-4} install


More information about the xorg-commit mailing list