diff --git a/include/wx/osx/frame.h b/include/wx/osx/frame.h index 195145281f..9a493773fa 100644 --- a/include/wx/osx/frame.h +++ b/include/wx/osx/frame.h @@ -21,7 +21,7 @@ class WXDLLIMPEXP_CORE wxFrame: public wxFrameBase { public: // construction - wxFrame() { Init(); } + wxFrame() { } wxFrame(wxWindow *parent, wxWindowID id, const wxString& title, @@ -30,8 +30,6 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { - Init(); - Create(parent, id, title, pos, size, style, name); } @@ -75,19 +73,12 @@ public: const wxString& name = wxStatusLineNameStr) wxOVERRIDE; #endif // wxUSE_STATUSBAR - // called by wxWindow whenever it gets focus - void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } - wxWindow *GetLastFocus() const { return m_winLastFocused; } - void PositionBars(); // internal response to size events virtual void MacOnInternalSize() wxOVERRIDE { PositionBars(); } protected: - // common part of all ctors - void Init(); - #if wxUSE_TOOLBAR virtual void PositionToolBar() wxOVERRIDE; #endif @@ -104,9 +95,6 @@ protected: virtual void AttachMenuBar(wxMenuBar *menubar) wxOVERRIDE; #endif - // the last focused child: we restore focus to it on activation - wxWindow *m_winLastFocused; - virtual bool MacIsChildOfClientArea( const wxWindow* child ) const wxOVERRIDE; wxDECLARE_EVENT_TABLE(); diff --git a/src/osx/carbon/frame.cpp b/src/osx/carbon/frame.cpp index 4b27f3d719..d0033a3d5d 100644 --- a/src/osx/carbon/frame.cpp +++ b/src/osx/carbon/frame.cpp @@ -36,11 +36,6 @@ wxEND_EVENT_TABLE() // creation/destruction // ---------------------------------------------------------------------------- -void wxFrame::Init() -{ - m_winLastFocused = NULL; -} - bool wxFrame::Create(wxWindow *parent, wxWindowID id, const wxString& title, @@ -156,38 +151,10 @@ void wxFrame::OnActivate(wxActivateEvent& event) { if ( !event.GetActive() ) { - // remember the last focused child if it is our child - m_winLastFocused = FindFocus(); - - // so we NULL it out if it's a child from some other frame - wxWindow *win = m_winLastFocused; - while ( win ) - { - if ( win->IsTopLevel() ) - { - if ( win != this ) - m_winLastFocused = NULL; - - break; - } - - win = win->GetParent(); - } - event.Skip(); } else { - // restore focus to the child which was last focused - wxWindow *parent = m_winLastFocused - ? m_winLastFocused->GetParent() - : NULL; - - if (parent == NULL) - parent = this; - - wxSetFocusToChild(parent, &m_winLastFocused); - #if wxUSE_MENUS if (m_frameMenuBar != NULL) { diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 5928260429..8ec3e2500a 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -239,20 +239,6 @@ wxWindowMac::~wxWindowMac() MacInvalidateBorders() ; -#ifndef __WXUNIVERSAL__ - // VS: make sure there's no wxFrame with last focus set to us: - for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) - { - wxFrame *frame = wxDynamicCast(win, wxFrame); - if ( frame ) - { - if ( frame->GetLastFocus() == this ) - frame->SetLastFocus(NULL); - break; - } - } -#endif - // destroy children before destroying this window itself DestroyChildren(); @@ -266,15 +252,6 @@ wxWindowMac::~wxWindowMac() tlw->SetDefaultItem(NULL); } -#ifndef __WXUNIVERSAL__ - wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( (wxWindow*)this ) , wxFrame ) ; - if ( frame ) - { - if ( frame->GetLastFocus() == this ) - frame->SetLastFocus( NULL ) ; - } -#endif - // delete our drop target if we've got one #if wxUSE_DRAG_AND_DROP wxDELETE(m_dropTarget);