From 14b35ef217f5ee387c4f33b1b24bebb015e18f23 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 7 Jan 2023 19:27:18 -0500 Subject: Replace map/unmap events with more expressive configure events --- test/test_show_hide.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'test/test_show_hide.c') diff --git a/test/test_show_hide.c b/test/test_show_hide.c index a5c8622..6664a1e 100644 --- a/test/test_show_hide.c +++ b/test/test_show_hide.c @@ -20,7 +20,6 @@ typedef enum { START, REALIZED, - CONFIGURED, MAPPED, EXPOSED, UNMAPPED, @@ -49,22 +48,16 @@ onEvent(PuglView* view, const PuglEvent* event) test->state = REALIZED; break; case PUGL_CONFIGURE: - if (test->state == REALIZED) { - test->state = CONFIGURED; + if (event->configure.style & PUGL_VIEW_STYLE_MAPPED) { + test->state = MAPPED; + } else { + test->state = UNMAPPED; } break; - case PUGL_MAP: - assert(test->state == CONFIGURED || test->state == UNMAPPED); - test->state = MAPPED; - break; case PUGL_EXPOSE: assert(test->state == MAPPED || test->state == EXPOSED); test->state = EXPOSED; break; - case PUGL_UNMAP: - assert(test->state == MAPPED || test->state == EXPOSED); - test->state = UNMAPPED; - break; case PUGL_UNREALIZE: assert(test->state == UNMAPPED); test->state = UNREALIZED; -- cgit v1.2.1