From 28631e2b202e661084039464f45228b9ce323a8f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 7 Jan 2023 19:27:00 -0500 Subject: Replace visible flag with a more descriptive view "stage" --- src/mac.m | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mac.m') diff --git a/src/mac.m b/src/mac.m index 5236d43..b8e30df 100644 --- a/src/mac.m +++ b/src/mac.m @@ -213,7 +213,9 @@ updateViewRect(PuglView* view) - (void)setIsVisible:(BOOL)flag { - if (flag && !puglview->visible) { + [super setIsVisible:flag]; + + if (flag && puglview->stage < PUGL_VIEW_STAGE_MAPPED) { const PuglConfigureEvent ev = { PUGL_CONFIGURE, 0, @@ -227,13 +229,9 @@ updateViewRect(PuglView* view) configureEvent.configure = ev; puglDispatchEvent(puglview, &configureEvent); puglDispatchSimpleEvent(puglview, PUGL_MAP); - } else if (!flag && puglview->visible) { + } else if (!flag && puglview->stage == PUGL_VIEW_STAGE_MAPPED) { puglDispatchSimpleEvent(puglview, PUGL_UNMAP); } - - puglview->visible = flag; - - [super setIsVisible:flag]; } @end -- cgit v1.2.1