summaryrefslogtreecommitdiff
path: root/test/replicas.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/replicas.zig')
-rw-r--r--test/replicas.zig12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/replicas.zig b/test/replicas.zig
index bd759b03..48ffe5d4 100644
--- a/test/replicas.zig
+++ b/test/replicas.zig
@@ -413,6 +413,8 @@ const Client = struct {
wake_at: u64 = 0,
drew: bool = false,
resize: ?pardes.Event = null,
+ /// gui.zig `Client.posted`: a size posted once while it waits.
+ posted: ?@FieldType(pardes.Event, "resize") = null,
resizes: u32 = 0,
fn present(ctx: ?*anyopaque, _: *const pardes.Surface) void {
@@ -453,9 +455,12 @@ const Client = struct {
if (cl.kind != .window) return;
cl.r.?.within(cl, own);
if (cl.resize) |ev| {
- cl.link.input(ev);
- cl.resizes += 1;
- }
+ if (cl.posted == null or !std.meta.eql(cl.posted.?, ev.resize)) {
+ cl.link.input(ev);
+ cl.resizes += 1;
+ }
+ cl.posted = ev.resize;
+ } else cl.posted = null;
cl.resize = null;
}
};
@@ -1050,6 +1055,7 @@ fn run(r: Run, dir: []const u8, totals: *Totals) !void {
if (c == 1) cl.link.test_diverge = 40;
}
cl.link.reset(rp, &j);
+ cl.posted = null;
// What it is, then its size, are its view's first inputs
// (the window's size from its own pass over its view).
cl.link.input(.{ .frontend = if (cl.kind == .window) .{ .windowed = true, .native_images = true, .native_image_patches = true } else .{ .windowed = false } });