diff options
author | David Robillard <d@drobilla.net> | 2019-07-24 23:46:17 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-09-03 08:32:16 +0200 |
commit | 5081d49f9f08596c07a8ed32430a4fa3e1baf352 (patch) | |
tree | 1e654d4fc34ea582e356373ae5bd39fac91ae3bc /pugl/detail/mac.m | |
parent | da0f76d22df1813a386f2b5e35ebe637da78889f (diff) | |
download | pugl-5081d49f9f08596c07a8ed32430a4fa3e1baf352.tar.gz pugl-5081d49f9f08596c07a8ed32430a4fa3e1baf352.tar.bz2 pugl-5081d49f9f08596c07a8ed32430a4fa3e1baf352.zip |
Add puglHasFocus()
Diffstat (limited to 'pugl/detail/mac.m')
-rw-r--r-- | pugl/detail/mac.m | 9 |
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) { |