summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Snowhill2024-04-20 05:58:03 -0700
committerChristopher Snowhill2024-04-20 05:58:03 -0700
commit127de98fa37f2dc629bb217ea6d33e720b293fcf (patch)
tree97e2de159f504d517da55fdcfb61b9581b4272e4
parenta8fb4a0c823d0db892292386307f2408e84be6f9 (diff)
downloadaur-127de98fa37f2dc629bb217ea6d33e720b293fcf.tar.gz
Add xcb_send_message patch
Thanks, ammen99!
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD9
-rw-r--r--xcb-send-message.patch58
3 files changed, 67 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ffd9b1eaeb93..19ea0b27f003 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = wlroots-hidpi-xprop
pkgdesc = Modular Wayland compositor library (stable, with patches)
pkgver = 0.17.2
- pkgrel = 4
+ pkgrel = 5
url = https://gitlab.freedesktop.org/wlroots/wlroots
arch = x86_64
license = MIT
@@ -36,10 +36,12 @@ pkgbase = wlroots-hidpi-xprop
source = 0002-Fix-configure_notify-event.patch
source = 0003-Fix-size-hints-under-Xwayland-scaling.patch
source = 4629.patch
+ source = xcb-send-message.patch
sha512sums = 568d6f74a60ed4c1150cd9520df7a2bd55bc306732a4c8ccaa722bf7737075f9934dc48c330276d2a96d3ffa4aa35cc6023b09375557e89589eb026a3de5b5b9
sha512sums = ca05b46c8222e6982c848944ff2afe7765a2e76bb90e29c9d5b5dde9b51a0038bce8b0d52d01c390c970319ef10614ab1454a66940bf3a5b6193fc7f189afe6b
sha512sums = 484c8a6848b1409a16403bf0c3e366bf5203716824c24e16efcdcdb71ff34c42b5da6e3da338fafea70ad80fcdd3d6e9f070fb809093d8b0b08ee0b2c95a4de4
sha512sums = 8e3e77f6df204b6e5aa770be61fc8a6525e295cc8acdb0084ce66463e78f11702cf066640b20d7ff9560bdcdf7fa626db2e90651dcd42670250f45ac0f636854
sha512sums = 5648d43fca061ee4b72dfb2cf41a8b100d7d7bb6a15a6e06a6f2bbbcdfb19495c38bb6f0bd8ca1604244eb7bf3aec9563395fc72e766bc1cf9b1767995513567
+ sha512sums = 993bbf9543846aad04653d3430e494c0049db05dff901ffad4e53ee5cf589a5efc2b1985f70b8fcdff99da7a6a3fdf8098d1109134788575f4036b1e01bbc461
pkgname = wlroots-hidpi-xprop
diff --git a/PKGBUILD b/PKGBUILD
index afe9338fa06b..a89d0716bef4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
# Contributor: Antonin Décimo <antonin dot decimo at gmail dot com>
pkgname=wlroots-hidpi-xprop
pkgver=0.17.2
-pkgrel=4
+pkgrel=5
license=(MIT)
pkgdesc='Modular Wayland compositor library (stable, with patches)'
url=https://gitlab.freedesktop.org/wlroots/wlroots
@@ -43,12 +43,14 @@ source=("${pkgname}::git+${url}#tag=${pkgver}"
0001-xwayland-support-HiDPI-scale.patch
0002-Fix-configure_notify-event.patch
0003-Fix-size-hints-under-Xwayland-scaling.patch
- 4629.patch)
+ 4629.patch
+ xcb-send-message.patch)
sha512sums=('568d6f74a60ed4c1150cd9520df7a2bd55bc306732a4c8ccaa722bf7737075f9934dc48c330276d2a96d3ffa4aa35cc6023b09375557e89589eb026a3de5b5b9'
'ca05b46c8222e6982c848944ff2afe7765a2e76bb90e29c9d5b5dde9b51a0038bce8b0d52d01c390c970319ef10614ab1454a66940bf3a5b6193fc7f189afe6b'
'484c8a6848b1409a16403bf0c3e366bf5203716824c24e16efcdcdb71ff34c42b5da6e3da338fafea70ad80fcdd3d6e9f070fb809093d8b0b08ee0b2c95a4de4'
'8e3e77f6df204b6e5aa770be61fc8a6525e295cc8acdb0084ce66463e78f11702cf066640b20d7ff9560bdcdf7fa626db2e90651dcd42670250f45ac0f636854'
- '5648d43fca061ee4b72dfb2cf41a8b100d7d7bb6a15a6e06a6f2bbbcdfb19495c38bb6f0bd8ca1604244eb7bf3aec9563395fc72e766bc1cf9b1767995513567')
+ '5648d43fca061ee4b72dfb2cf41a8b100d7d7bb6a15a6e06a6f2bbbcdfb19495c38bb6f0bd8ca1604244eb7bf3aec9563395fc72e766bc1cf9b1767995513567'
+ '993bbf9543846aad04653d3430e494c0049db05dff901ffad4e53ee5cf589a5efc2b1985f70b8fcdff99da7a6a3fdf8098d1109134788575f4036b1e01bbc461')
prepare () {
cd "${pkgname}"
@@ -57,6 +59,7 @@ prepare () {
patch -Np1 < ../0002-Fix-configure_notify-event.patch
patch -Np1 < ../0003-Fix-size-hints-under-Xwayland-scaling.patch
patch -Np1 < ../4629.patch
+ patch -Np1 < ../xcb-send-message.patch
}
build () {
diff --git a/xcb-send-message.patch b/xcb-send-message.patch
new file mode 100644
index 000000000000..c3fb363244e3
--- /dev/null
+++ b/xcb-send-message.patch
@@ -0,0 +1,58 @@
+diff --git a/xwayland/xwm.c b/xwayland/xwm.c
+index 2c437e83..478ea6fa 100644
+--- a/xwayland/xwm.c
++++ b/xwayland/xwm.c
+@@ -217,6 +217,25 @@ static void xwm_set_net_active_window(struct wlr_xwm *xwm,
+ xwm->atoms[WINDOW], 32, 1, &window);
+ }
+
++/*
++ * Wrapper for xcb_send_event, which ensures that the event data is 32 byte big.
++ */
++static xcb_void_cookie_t xwm_send_event(xcb_connection_t *c,
++ uint8_t propagate, xcb_window_t destination,
++ uint32_t event_mask, const char *event, uint32_t length)
++{
++ if (length == 32) {
++ return xcb_send_event(c, propagate, destination, event_mask, event);
++ } else if (length < 32) {
++ char buf[32];
++ memcpy(buf, event, length);
++ memset(buf + length, 0, 32 - length);
++ return xcb_send_event(c, propagate, destination, event_mask, buf);
++ } else {
++ assert(false && "Event too long");
++ }
++}
++
+ static void xwm_send_wm_message(struct wlr_xwayland_surface *surface,
+ xcb_client_message_data_t *data, uint32_t event_mask) {
+ struct wlr_xwm *xwm = surface->xwm;
+@@ -230,11 +249,12 @@ static void xwm_send_wm_message(struct wlr_xwayland_surface *surface,
+ .data = *data,
+ };
+
+- xcb_send_event(xwm->xcb_conn,
++ xwm_send_event(xwm->xcb_conn,
+ 0, // propagate
+ surface->window_id,
+ event_mask,
+- (const char *)&event);
++ (const char *)&event,
++ sizeof(event));
+ xcb_flush(xwm->xcb_conn);
+ }
+
+@@ -1795,9 +1815,10 @@ void wlr_xwayland_surface_configure(struct wlr_xwayland_surface *xsurface,
+ .height = height,
+ };
+
+- xcb_send_event(xwm->xcb_conn, 0, xsurface->window_id,
++ xwm_send_event(xwm->xcb_conn, 0, xsurface->window_id,
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY,
+- (const char *)&configure_notify);
++ (const char *)&configure_notify,
++ sizeof(configure_notify));
+ }
+
+ xcb_flush(xwm->xcb_conn);