linux-dmabuf: send better per-surface feedback

This commit leverages the new wlr_scene helper to send custom feedback
per surface rather than using the same default feedback for every
surface. This should allow direct scanout to work more reliably with
multiple outputs for example.
This commit is contained in:
Isaac Freund 2024-01-03 17:23:53 -06:00
parent 80ced04f68
commit 28dcd8320a
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
2 changed files with 4 additions and 1 deletions

View File

@ -129,6 +129,8 @@ pub fn init(self: *Self) !void {
const scene = try wlr.Scene.create(); const scene = try wlr.Scene.create();
errdefer scene.tree.node.destroy(); errdefer scene.tree.node.destroy();
scene.setLinuxDmabufV1(server.linux_dmabuf);
const interactive_content = try scene.tree.createSceneTree(); const interactive_content = try scene.tree.createSceneTree();
const drag_icons = try scene.tree.createSceneTree(); const drag_icons = try scene.tree.createSceneTree();
const hidden_tree = try scene.tree.createSceneTree(); const hidden_tree = try scene.tree.createSceneTree();

View File

@ -51,6 +51,7 @@ backend: *wlr.Backend,
session: ?*wlr.Session, session: ?*wlr.Session,
renderer: *wlr.Renderer, renderer: *wlr.Renderer,
linux_dmabuf: *wlr.LinuxDmabufV1,
allocator: *wlr.Allocator, allocator: *wlr.Allocator,
xdg_shell: *wlr.XdgShell, xdg_shell: *wlr.XdgShell,
@ -98,7 +99,7 @@ pub fn init(self: *Self) !void {
try self.renderer.initWlShm(self.wl_server); try self.renderer.initWlShm(self.wl_server);
if (self.renderer.getDmabufFormats() != null and self.renderer.getDrmFd() >= 0) { if (self.renderer.getDmabufFormats() != null and self.renderer.getDrmFd() >= 0) {
_ = try wlr.LinuxDmabufV1.createWithRenderer(self.wl_server, 4, self.renderer); self.linux_dmabuf = try wlr.LinuxDmabufV1.createWithRenderer(self.wl_server, 4, self.renderer);
} }
self.allocator = try wlr.Allocator.autocreate(self.backend, self.renderer); self.allocator = try wlr.Allocator.autocreate(self.backend, self.renderer);