aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-07 19:27:00 -0500
committerDavid Robillard <d@drobilla.net>2023-01-07 19:27:00 -0500
commit28631e2b202e661084039464f45228b9ce323a8f (patch)
tree6b8d7f586052093e3d47e33d6db04f71406c1bdb /src/mac.m
parentb6ecd23cfb3c82c2c3f05795ebd9c65314e6367c (diff)
downloadpugl-28631e2b202e661084039464f45228b9ce323a8f.tar.gz
pugl-28631e2b202e661084039464f45228b9ce323a8f.tar.bz2
pugl-28631e2b202e661084039464f45228b9ce323a8f.zip
Replace visible flag with a more descriptive view "stage"
Diffstat (limited to 'src/mac.m')
-rw-r--r--src/mac.m10
1 files changed, 4 insertions, 6 deletions
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