From c30e11788ef669b3e66788d8823696af902c7951 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 May 2020 21:17:56 +0200 Subject: Fix redisplay test on MacOS This does two things: posts the redisplay when an update event is received (which is correct pattern for this now), and uses larger even numbers for the redisplay region so they make it through the pixel/point conversion process without loss. --- test/test_redisplay.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test_redisplay.c b/test/test_redisplay.c index 75006cb..d5b40b0 100644 --- a/test/test_redisplay.c +++ b/test/test_redisplay.c @@ -53,7 +53,7 @@ typedef struct State state; } PuglTest; -static const PuglRect redisplayRect = {1, 2, 3, 4}; +static const PuglRect redisplayRect = {2, 4, 8, 16}; static const uintptr_t postRedisplayId = 42; static PuglStatus @@ -66,6 +66,13 @@ onEvent(PuglView* view, const PuglEvent* event) } switch (event->type) { + case PUGL_UPDATE: + if (test->state == SHOULD_REDISPLAY) { + puglPostRedisplayRect(view, redisplayRect); + test->state = POSTED_REDISPLAY; + } + break; + case PUGL_EXPOSE: if (test->state == START) { test->state = EXPOSED; @@ -80,8 +87,7 @@ onEvent(PuglView* view, const PuglEvent* event) case PUGL_CLIENT: if (event->client.data1 == postRedisplayId) { - puglPostRedisplayRect(view, redisplayRect); - test->state = POSTED_REDISPLAY; + test->state = SHOULD_REDISPLAY; } break; -- cgit v1.2.1