From f953bf762f6bac81c2bdd860614a161d8fc40218 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Aug 2022 01:08:15 +0200 Subject: [PATCH] Generate wxEVT_KILL_FOCUS for wxSearchCtrl under Mac Do it using controlTextDidChange: notification as it's already done for wxTextCtrl and wxComboBox. See #22702. Closes #22706. (cherry picked from commit 0bb0fe24d137ad7768055cddd4686ed22aba17e2) --- src/osx/cocoa/srchctrl.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index b5efe28734..92bbcefa7e 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -75,6 +75,14 @@ impl->controlTextDidChange(); } +- (void)controlTextDidEndEditing:(NSNotification *) aNotification +{ + wxUnusedVar(aNotification); + wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); + if ( impl ) + impl->DoNotifyFocusLost(); +} + - (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(int*)index {