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 --- src/mac.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/mac.m') diff --git a/src/mac.m b/src/mac.m index 72f5f9c..042832b 100644 --- a/src/mac.m +++ b/src/mac.m @@ -187,8 +187,10 @@ getCurrentViewStyleFlags(PuglView* const view) const bool isFullScreen = styleMask & NSWindowStyleMaskFullScreen; const bool isMiniaturized = [view->impl->window isMiniaturized]; const bool isZoomed = [view->impl->window isZoomed]; + const bool isVisible = [view->impl->window isVisible]; - return (isFullScreen ? PUGL_VIEW_STYLE_FULLSCREEN : 0U) | + return (isVisible ? PUGL_VIEW_STYLE_MAPPED : 0U) | + (isFullScreen ? PUGL_VIEW_STYLE_FULLSCREEN : 0U) | (isMiniaturized ? PUGL_VIEW_STYLE_HIDDEN : 0U) | (isZoomed ? (PUGL_VIEW_STYLE_TALL | PUGL_VIEW_STYLE_WIDE) : 0U) | (isResizing ? PUGL_VIEW_STYLE_RESIZING : 0U); @@ -254,11 +256,8 @@ getCurrentViewStyleFlags(PuglView* const view) { [super setIsVisible:flag]; - if (flag && puglview->stage < PUGL_VIEW_STAGE_MAPPED) { + if (flag != (puglview->lastConfigure.style & PUGL_VIEW_STYLE_MAPPED)) { [self dispatchCurrentConfiguration]; - puglDispatchSimpleEvent(puglview, PUGL_MAP); - } else if (!flag && puglview->stage == PUGL_VIEW_STAGE_MAPPED) { - puglDispatchSimpleEvent(puglview, PUGL_UNMAP); } } -- cgit v1.2.1