From a2a5e8f4632374b4b322c0520b7e30e35e0d753a Mon Sep 17 00:00:00 2001 From: tesselslate Date: Mon, 4 Nov 2024 21:03:34 -0500 Subject: [PATCH] alpha-modifier-v1: implement protocol Implement the alpha-modifier-v1 protocol, which allows clients to offload alpha blending operations to the compositor. wlroots' scene graph code takes care of updating the opacity of wlr_scene_buffers with an associated wp_alpha_modifier_surface_v1. --- build.zig.zon | 4 ++-- river/Server.zig | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index b35b27e..39ce52b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -12,8 +12,8 @@ .hash = "1220687c8c47a48ba285d26a05600f8700d37fc637e223ced3aa8324f3650bf52242", }, .@"zig-wlroots" = .{ - .url = "https://codeberg.org/ifreund/zig-wlroots/archive/e486223799648d27e8b91c5fe0ea4c088b74b707.tar.gz", - .hash = "1220aeb3317e16c38583839961c9d695fa60d23a3d506c8275fb0e8fa9849844f2f7", + .url = "https://codeberg.org/ifreund/zig-wlroots/archive/afbbbbe5579c750feed8de12b073fa50b0651137.tar.gz", + .hash = "122060ddef836b7872cb2088764a8bd2fb2e9254327673e8176b7f7a621ec897484f", }, .@"zig-xkbcommon" = .{ .url = "https://codeberg.org/ifreund/zig-xkbcommon/archive/v0.2.0.tar.gz", diff --git a/river/Server.zig b/river/Server.zig index 8fc7422..027e777 100644 --- a/river/Server.zig +++ b/river/Server.zig @@ -86,6 +86,8 @@ foreign_toplevel_manager: *wlr.ForeignToplevelManagerV1, tearing_control_manager: *wlr.TearingControlManagerV1, +alpha_modifier: *wlr.AlphaModifierV1, + input_manager: InputManager, root: Root, config: Config, @@ -163,6 +165,8 @@ pub fn init(server: *Server, runtime_xwayland: bool) !void { .tearing_control_manager = try wlr.TearingControlManagerV1.create(wl_server, 1), + .alpha_modifier = try wlr.AlphaModifierV1.create(wl_server), + .config = try Config.init(), .root = undefined, @@ -321,7 +325,8 @@ fn allowlist(server: *Server, global: *const wl.Global) bool { global == server.input_manager.tablet_manager.global or global == server.input_manager.pointer_gestures.global or global == server.idle_inhibit_manager.wlr_manager.global or - global == server.tearing_control_manager.global; + global == server.tearing_control_manager.global or + global == server.alpha_modifier.global; } /// Returns true if the global is blocked for security contexts