From e5021b23c93af5df2ce891fb2d2164377c520293 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 27 Nov 2012 13:23:46 +0000 Subject: [PATCH] emulating wx' focus-lost behavior git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/nonownedwnd.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 7f73ffed91..103f97a7e3 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -450,12 +450,19 @@ extern int wxOSXGetIdFromSelector(SEL action ); if ( wxpeer ) { wxpeer->HandleActivated(0, false); + // as for wx the deactivation also means loosing focus we + // must trigger this manually + [window makeFirstResponder:nil]; + + // TODO Remove if no problems arise with Popup Windows +#if 0 // Needed for popup window since the firstResponder // (focus in wx) doesn't change when this // TLW becomes inactive. wxFocusEvent event( wxEVT_KILL_FOCUS, wxpeer->GetId()); event.SetEventObject(wxpeer); wxpeer->HandleWindowEvent(event); +#endif } } } -- 2.45.2