From 55037c44cf15e3e379f7025d8adceb00e07d964d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 2 Dec 2005 14:19:35 +0000 Subject: [PATCH] avoid problem with focus leaving before it has arrived(?) svn: r1488 --- src/wxmac/src/mac/wx_frame.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wxmac/src/mac/wx_frame.cc b/src/wxmac/src/mac/wx_frame.cc index 973ee2ab77..1295d32afe 100644 --- a/src/wxmac/src/mac/wx_frame.cc +++ b/src/wxmac/src/mac/wx_frame.cc @@ -927,11 +927,13 @@ void wxFrame::ShowAsActive(Bool flag) if (!(cStyle & wxFLOAT_FRAME) || !(cStyle & wxNO_CAPTION)) { TakeoverFocus(); - cFocusWindow->OnSetFocus(); + if (cFocusWindow) + cFocusWindow->OnSetFocus(); } } else { ReleaseFocus(); - cFocusWindow->OnKillFocus(); + if (cFocusWindow) + cFocusWindow->OnKillFocus(); } } }