diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 6c38fdf74f..16f9291271 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -89,8 +89,12 @@ public : ms_viewCurrentlyEdited = m_viewPreviouslyEdited; } - // Returns the last view we were instantiated for or NULL. - static NSView *GetCurrentlyEditedView() { return ms_viewCurrentlyEdited; } + // Returns true if this view is the one currently being changed by the + // program. + static bool IsCurrentlyEditedView(NSView* v) + { + return v == ms_viewCurrentlyEdited; + } protected : BOOL m_formerEditable ; @@ -334,7 +338,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; { wxUnusedVar(aNotification); - if ( self == wxMacEditHelper::GetCurrentlyEditedView() ) + if ( wxMacEditHelper::IsCurrentlyEditedView(self) ) { // This notification is generated as the result of calling our own // wxTextCtrl method (e.g. WriteText()) and doesn't correspond to any