aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_show_hide.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-07 19:27:18 -0500
committerDavid Robillard <d@drobilla.net>2023-01-07 20:27:35 -0500
commit14b35ef217f5ee387c4f33b1b24bebb015e18f23 (patch)
tree2e9ea2b44dfc9e3108f1a1c489f6842273404272 /test/test_show_hide.c
parent4ad8621ac1d94c8e9cf88f83c46a3a70cd91212b (diff)
downloadpugl-14b35ef217f5ee387c4f33b1b24bebb015e18f23.tar.gz
pugl-14b35ef217f5ee387c4f33b1b24bebb015e18f23.tar.bz2
pugl-14b35ef217f5ee387c4f33b1b24bebb015e18f23.zip
Replace map/unmap events with more expressive configure events
Diffstat (limited to 'test/test_show_hide.c')
-rw-r--r--test/test_show_hide.c15
1 files changed, 4 insertions, 11 deletions
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;