aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-24 23:46:26 +0200
committerDavid Robillard <d@drobilla.net>2019-09-03 08:32:16 +0200
commitda0f76d22df1813a386f2b5e35ebe637da78889f (patch)
treed49ed1eabf44538fcbdf24e42b90b5051d3263a3 /pugl
parente148e8f3646ae756254879f2df015431bbd036ed (diff)
downloadpugl-da0f76d22df1813a386f2b5e35ebe637da78889f.tar.gz
pugl-da0f76d22df1813a386f2b5e35ebe637da78889f.tar.bz2
pugl-da0f76d22df1813a386f2b5e35ebe637da78889f.zip
Fix puglGrabFocus() to work between parent and children
Diffstat (limited to 'pugl')
-rw-r--r--pugl/detail/mac.m5
-rw-r--r--pugl/detail/x11.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index 5b332f1..a438701 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -772,7 +772,10 @@ puglDestroy(PuglView* view)
void
puglGrabFocus(PuglView* view)
{
- [view->impl->window makeKeyWindow];
+ NSWindow* window = [view->impl->wrapperView window];
+
+ [window makeKeyWindow];
+ [window makeFirstResponder:view->impl->wrapperView];
}
void
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index e6057af..a766ace 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -440,7 +440,7 @@ void
puglGrabFocus(PuglView* view)
{
XSetInputFocus(
- view->impl->display, view->impl->win, RevertToPointerRoot, CurrentTime);
+ view->impl->display, view->impl->win, RevertToNone, CurrentTime);
}
void