From da0f76d22df1813a386f2b5e35ebe637da78889f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 24 Jul 2019 23:46:26 +0200 Subject: Fix puglGrabFocus() to work between parent and children --- pugl/detail/mac.m | 5 ++++- pugl/detail/x11.c | 2 +- 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 -- cgit v1.2.1