aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
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 /src/mac.m
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 'src/mac.m')
-rw-r--r--src/mac.m9
1 files changed, 4 insertions, 5 deletions
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);
}
}