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.
This commit is contained in:
Isaac Freund 2021-01-07 16:09:50 +01:00
parent faca330bd0
commit a672738603
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -226,7 +226,24 @@ fn renderViewPopups(output: *const Output, view: *View, now: *os.timespec) void
.when = now, .when = now,
.opacity = view.opacity, .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 { fn renderDragIcons(output: *const Output, now: *os.timespec) void {