From 16c938111da571765409947ee371017478633c4c Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 13 Jun 2024 11:15:44 +0200 Subject: [PATCH 1/5] ci: use mirror for zig tarball downloads Eat Github's resources rather than the Zig Software Foundation's resources! --- .builds/alpine.yml | 3 ++- .builds/archlinux.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.builds/alpine.yml b/.builds/alpine.yml index 29be9f6..47a591d 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -40,7 +40,8 @@ tasks: sudo ninja -C build/ install cd .. - wget -nv https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz + # Eat Github's resources rather than the Zig Software Foundation's resources! + wget -nv https://github.com/ifreund/zig-tarball-mirror/releases/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz tar xf zig-linux-x86_64-0.13.0.tar.xz sudo mv zig-linux-x86_64-0.13.0/zig /usr/bin/ sudo mv zig-linux-x86_64-0.13.0/lib /usr/lib/zig diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml index 5025899..b900f6a 100644 --- a/.builds/archlinux.yml +++ b/.builds/archlinux.yml @@ -38,7 +38,8 @@ tasks: sudo ninja -C build/ install cd .. - wget -nv https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz + # Eat Github's resources rather than the Zig Software Foundation's resources! + wget -nv https://github.com/ifreund/zig-tarball-mirror/releases/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz tar xf zig-linux-x86_64-0.13.0.tar.xz sudo mv zig-linux-x86_64-0.13.0/zig /usr/bin/ sudo mv zig-linux-x86_64-0.13.0/lib /usr/lib/zig From f9201ae7cdc9cf7c36817c81df0134942bfbc3cb Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 13 Jun 2024 11:12:56 +0200 Subject: [PATCH 2/5] ci: re-enable FreeBSD builds Official FreeBSD zig tarballs have returned! This reverts commit 7fdba05b8249b10d10a2c64c1175429539c01af1. --- .builds/freebsd.yml | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .builds/freebsd.yml diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml new file mode 100644 index 0000000..ce82620 --- /dev/null +++ b/.builds/freebsd.yml @@ -0,0 +1,62 @@ +image: freebsd/latest +packages: + - devel/evdev-proto + - devel/libevdev + - devel/libepoll-shim + - devel/libudev-devd + - devel/meson + - devel/pkgconf + - graphics/mesa-libs + - graphics/wayland-protocols + - misc/hwdata + - x11/libX11 + - x11/libinput + - x11/libxcb + - x11/libxkbcommon + - x11/pixman + - x11/xcb-util-errors + - x11/xcb-util-renderutil + - x11/xcb-util-wm + - x11-servers/xwayland + - security/ca_root_nss + - sysutils/seatd + - sysutils/libdisplay-info + - gmake + - scdoc + - wget +sources: + - https://codeberg.org/river/river + - https://gitlab.freedesktop.org/wayland/wayland.git + - https://gitlab.freedesktop.org/wlroots/wlroots.git +tasks: + - install_deps: | + cd wayland + git checkout 1.22.0 + meson setup build -Ddocumentation=false -Dtests=false --prefix /usr + sudo ninja -C build install + cd .. + + cd wlroots + git checkout 0.17.2 + meson setup build --auto-features=enabled -Drenderers=gles2 -Dexamples=false \ + -Dwerror=false -Db_ndebug=false --prefix /usr + sudo ninja -C build/ install + cd .. + + # Eat Github's resources rather than the Zig Software Foundation's resources! + wget -nv https://github.com/ifreund/zig-tarball-mirror/releases/download/0.13.0/zig-freebsd-x86_64-0.13.0.tar.xz + tar xf zig-freebsd-x86_64-0.13.0.tar.xz + sudo mv zig-freebsd-x86_64-0.13.0/zig /usr/bin/ + sudo mv zig-freebsd-x86_64-0.13.0/lib /usr/lib/zig + - build: | + cd river + zig build + - build_xwayland: | + cd river + zig build -Dxwayland + - fmt: | + cd river + zig fmt --check river/ + zig fmt --check riverctl/ + zig fmt --check rivertile/ + zig fmt --check build.zig From e2f3cd82521ba94bfb6907a05a3022fdc514a355 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 13 Jun 2024 11:37:13 +0200 Subject: [PATCH 3/5] ci: log build summaries --- .builds/alpine.yml | 4 ++-- .builds/archlinux.yml | 4 ++-- .builds/freebsd.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.builds/alpine.yml b/.builds/alpine.yml index 47a591d..ca47a9d 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -47,10 +47,10 @@ tasks: sudo mv zig-linux-x86_64-0.13.0/lib /usr/lib/zig - build: | cd river - zig build + zig build --summary all - build_xwayland: | cd river - zig build -Dxwayland + zig build --summary all -Dxwayland - fmt: | cd river zig fmt --check river/ diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml index b900f6a..7e94459 100644 --- a/.builds/archlinux.yml +++ b/.builds/archlinux.yml @@ -45,10 +45,10 @@ tasks: sudo mv zig-linux-x86_64-0.13.0/lib /usr/lib/zig - build: | cd river - zig build + zig build --summary all - build_xwayland: | cd river - zig build -Dxwayland + zig build --summary all -Dxwayland - fmt: | cd river zig fmt --check river/ diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index ce82620..eeb1d1b 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -50,10 +50,10 @@ tasks: sudo mv zig-freebsd-x86_64-0.13.0/lib /usr/lib/zig - build: | cd river - zig build + zig build --summary all - build_xwayland: | cd river - zig build -Dxwayland + zig build --summary all -Dxwayland - fmt: | cd river zig fmt --check river/ From 28a14c6794ddc21a23d2e14d41761007d15569e8 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 13 Jun 2024 12:36:00 +0200 Subject: [PATCH 4/5] SceneNodeData: fix fromSurface() use after free We must clean up the user data of the wlr_surface for layer surfaces and lock surfaces as fromSurface() may be called (e.g. by the idle inhibit implementation) after the scene node has been destroyed but before the wlr_surface is destroyed. --- river/LayerSurface.zig | 4 +++- river/LockSurface.zig | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/river/LayerSurface.zig b/river/LayerSurface.zig index 03d243d..81dfe57 100644 --- a/river/LayerSurface.zig +++ b/river/LayerSurface.zig @@ -55,7 +55,6 @@ pub fn create(wlr_layer_surface: *wlr.LayerSurfaceV1) error{OutOfMemory}!void { .scene_layer_surface = try layer_tree.createSceneLayerSurfaceV1(wlr_layer_surface), .popup_tree = try output.layers.popups.createSceneTree(), }; - wlr_layer_surface.data = @intFromPtr(layer_surface); try SceneNodeData.attach(&layer_surface.scene_layer_surface.tree.node, .{ .layer_surface = layer_surface }); try SceneNodeData.attach(&layer_surface.popup_tree.node, .{ .layer_surface = layer_surface }); @@ -93,6 +92,9 @@ fn handleDestroy(listener: *wl.Listener(*wlr.LayerSurfaceV1), _: *wlr.LayerSurfa layer_surface.popup_tree.node.destroy(); + // The wlr_surface may outlive the wlr_layer_surface so we must clean up the user data. + layer_surface.wlr_layer_surface.surface.data = 0; + util.gpa.destroy(layer_surface); } diff --git a/river/LockSurface.zig b/river/LockSurface.zig index c3cd384..60f0aa8 100644 --- a/river/LockSurface.zig +++ b/river/LockSurface.zig @@ -85,6 +85,9 @@ pub fn destroy(lock_surface: *LockSurface) void { lock_surface.map.link.remove(); lock_surface.surface_destroy.link.remove(); + // The wlr_surface may outlive the wlr_lock_surface so we must clean up the user data. + lock_surface.wlr_lock_surface.surface.data = 0; + util.gpa.destroy(lock_surface); } From de3035563ccd5ea9f4fe0b843618e4265c880e30 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Fri, 14 Jun 2024 15:32:37 +0200 Subject: [PATCH 5/5] input: apply map-to-output on output activation Currently a map-to-output input config setting loses effect when an output is disabled and re-enabled for example. --- river/Root.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/river/Root.zig b/river/Root.zig index 7b87741..1dc0cba 100644 --- a/river/Root.zig +++ b/river/Root.zig @@ -416,6 +416,9 @@ pub fn activateOutput(root: *Root, output: *Output) void { } assert(root.fallback_pending.focus_stack.empty()); assert(root.fallback_pending.wm_stack.empty()); + + // Enforce map-to-output configuration for the newly active output. + server.input_manager.reconfigureDevices(); } /// Trigger asynchronous application of pending state for all outputs and views.