]> git.saurik.com Git - wxWidgets.git/commitdiff
emulating wx' focus-lost behavior
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 27 Nov 2012 13:23:46 +0000 (13:23 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 27 Nov 2012 13:23:46 +0000 (13:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/nonownedwnd.mm

index 7f73ffed916ecec4a2a79ceba9417cc001716e00..103f97a7e3da0b52e16add3969c4646201f5b9e0 100644 (file)
@@ -450,12 +450,19 @@ extern int wxOSXGetIdFromSelector(SEL action );
         if ( wxpeer )
         {
             wxpeer->HandleActivated(0, false);
         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);
             // 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
         }
     }
 }
         }
     }
 }