diff options
author | David Robillard <d@drobilla.net> | 2020-05-16 21:17:56 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-05-16 21:17:56 +0200 |
commit | c30e11788ef669b3e66788d8823696af902c7951 (patch) | |
tree | a5366f85af4391751b5edf117707afbc70b61850 /test | |
parent | 8fffa8f1f596b9553b291d4caa9f0c4de6f311b2 (diff) | |
download | pugl-c30e11788ef669b3e66788d8823696af902c7951.tar.gz pugl-c30e11788ef669b3e66788d8823696af902c7951.tar.bz2 pugl-c30e11788ef669b3e66788d8823696af902c7951.zip |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_redisplay.c | 12 |
1 files changed, 9 insertions, 3 deletions
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; |