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
This commit is contained in:
Tim Culverhouse 2024-11-26 06:52:28 -06:00
parent ca4d0b6491
commit f6871e3959

View file

@ -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();