Set first responder field in window after popover shows.

This commit is contained in:
David Kocher
2026-05-21 22:48:25 +02:00
parent f4d30ba025
commit 4e4e1c54c0
@@ -362,6 +362,7 @@ public class ProxyController extends AbstractController {
this.positioningRect = positioningRect; this.positioningRect = positioningRect;
this.controller = controller; this.controller = controller;
this.controller.addHandler(this); this.controller.addHandler(this);
this.controller.addListener(this);
this.behaviour = behaviour; this.behaviour = behaviour;
} }
@@ -378,7 +379,6 @@ public class ProxyController extends AbstractController {
popover.setContentViewController(viewController); popover.setContentViewController(viewController);
popover.showRelativeToRect_ofView_preferredEdge(positioningRect, positioningView, popover.showRelativeToRect_ofView_preferredEdge(positioningRect, positioningView,
FoundationKitFunctions.NSRectEdge.NSMinYEdge); FoundationKitFunctions.NSRectEdge.NSMinYEdge);
controller.addListener(this);
} }
@Override @Override
@@ -410,6 +410,11 @@ public class ProxyController extends AbstractController {
this.callback = callback; this.callback = callback;
} }
@Delegate
public void popoverDidShow(final NSNotification notification) {
controller.focus();
}
@Delegate @Delegate
public void popoverWillClose(final NSNotification notification) { public void popoverWillClose(final NSNotification notification) {
final NSObject popoverCloseReasonValue = notification.userInfo().objectForKey(NSPopover.NSPopoverCloseReasonKey); final NSObject popoverCloseReasonValue = notification.userInfo().objectForKey(NSPopover.NSPopoverCloseReasonKey);