aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/mac.m
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail/mac.m')
-rw-r--r--pugl/detail/mac.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index a438701..385070d 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -778,6 +778,15 @@ puglGrabFocus(PuglView* view)
[window makeFirstResponder:view->impl->wrapperView];
}
+bool
+puglHasFocus(const PuglView* view)
+{
+ PuglInternals* const impl = view->impl;
+
+ return ([[impl->wrapperView window] isKeyWindow] &&
+ [[impl->wrapperView window] firstResponder] == impl->wrapperView);
+}
+
void
puglRequestAttention(PuglView* view)
{