aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-08 01:02:07 -0500
committerDavid Robillard <d@drobilla.net>2023-01-08 01:06:37 -0500
commit92b5ab6bdfc8450ed3c4e4e7006cee949386dcd4 (patch)
treeaa91ae18efac00651f73efef51173edbcc00489f /src/mac.m
parent14b35ef217f5ee387c4f33b1b24bebb015e18f23 (diff)
downloadpugl-92b5ab6bdfc8450ed3c4e4e7006cee949386dcd4.tar.gz
pugl-92b5ab6bdfc8450ed3c4e4e7006cee949386dcd4.tar.bz2
pugl-92b5ab6bdfc8450ed3c4e4e7006cee949386dcd4.zip
Add support for raising windows
Diffstat (limited to 'src/mac.m')
-rw-r--r--src/mac.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mac.m b/src/mac.m
index 042832b..307a557 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -1311,7 +1311,7 @@ puglUnrealize(PuglView* const view)
}
PuglStatus
-puglShow(PuglView* view)
+puglShow(PuglView* view, const PuglShowCommand command)
{
if (!view->impl->wrapperView) {
const PuglStatus st = puglRealize(view);
@@ -1320,12 +1320,24 @@ puglShow(PuglView* view)
}
}
- if (![view->impl->window isVisible]) {
- [view->impl->window setIsVisible:YES];
+ NSWindow* const window = [view->impl->wrapperView window];
+ if (![window isVisible]) {
+ [window setIsVisible:YES];
[view->impl->drawView setNeedsDisplay:YES];
updateViewRect(view);
}
+ switch (command) {
+ case PUGL_SHOW_PASSIVE:
+ break;
+ case PUGL_SHOW_RAISE:
+ [window orderFront:view->impl->wrapperView];
+ break;
+ case PUGL_SHOW_FORCE_RAISE:
+ [window orderFrontRegardless];
+ break;
+ }
+
return PUGL_SUCCESS;
}