From a672738603e8a3d19849a8af7635b69962b63569 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 7 Jan 2021 16:09:50 +0100 Subject: [PATCH] render: iterate subsurfaces of popups manually wlr_xdg_surface_for_each_popup() fails to do this and wlr_xdg_surface_for_each_popup_surface() is not yet merged, so implement a workaround for now. --- river/render.zig | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/river/render.zig b/river/render.zig index 5c04182..e2b2097 100644 --- a/river/render.zig +++ b/river/render.zig @@ -226,7 +226,24 @@ fn renderViewPopups(output: *const Output, view: *View, now: *os.timespec) void .when = now, .opacity = view.opacity, }; - view.forEachPopup(*SurfaceRenderData, renderSurfaceIterator, &rdata); + view.forEachPopup(*SurfaceRenderData, renderPopupSurfaceIterator, &rdata); +} + +// TODO(wlroots): replace with wlr_xdg_surface_for_each_popup_surface() +fn renderPopupSurfaceIterator( + surface: *wlr.Surface, + surface_x: c_int, + surface_y: c_int, + rdata: *SurfaceRenderData, +) callconv(.C) void { + var new_rdata = SurfaceRenderData{ + .output = rdata.output, + .output_x = rdata.output_x + surface_x, + .output_y = rdata.output_y + surface_y, + .when = rdata.when, + .opacity = rdata.opacity, + }; + surface.forEachSurface(*SurfaceRenderData, renderSurfaceIterator, &new_rdata); } fn renderDragIcons(output: *const Output, now: *os.timespec) void {