From f6871e3959be6a6c3b71653d95aaa2a608272153 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 26 Nov 2024 06:52:28 -0600 Subject: [PATCH] vxfw: use correct root window size We previously passed the root window to the root surface, however the root surface could actually be smaller than the root window. This can lead to confusing rendering because it was possible for children to be rendered outside of their parent --- src/vxfw/App.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vxfw/App.zig b/src/vxfw/App.zig index 61f89f5..1044e12 100644 --- a/src/vxfw/App.zig +++ b/src/vxfw/App.zig @@ -165,7 +165,11 @@ pub fn run(self: *App, widget: vxfw.Widget, opts: Options) anyerror!void { const surface = try widget.draw(draw_context); const focused = self.wants_focus orelse focus_handler.focused.widget; - surface.render(win, focused); + const root_win = win.child(.{ + .width = surface.size.width, + .height = surface.size.height, + }); + surface.render(root_win, focused); try vx.render(buffered.writer().any()); try buffered.flush();