diff options
author | David Robillard <d@drobilla.net> | 2023-01-07 19:27:18 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-01-07 20:27:35 -0500 |
commit | 14b35ef217f5ee387c4f33b1b24bebb015e18f23 (patch) | |
tree | 2e9ea2b44dfc9e3108f1a1c489f6842273404272 /src/mac.m | |
parent | 4ad8621ac1d94c8e9cf88f83c46a3a70cd91212b (diff) | |
download | pugl-14b35ef217f5ee387c4f33b1b24bebb015e18f23.tar.gz pugl-14b35ef217f5ee387c4f33b1b24bebb015e18f23.tar.bz2 pugl-14b35ef217f5ee387c4f33b1b24bebb015e18f23.zip |
Replace map/unmap events with more expressive configure events
Diffstat (limited to 'src/mac.m')
-rw-r--r-- | src/mac.m | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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); } } |