diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index f86cdec15c..1eb9d99b28 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -405,11 +405,25 @@ bool wxWindowMac::SetBackgroundColour(const wxColour& col ) return true ; } +static bool wxIsWindowOrParentDisabled(wxWindow* w) +{ + while (w && !w->IsTopLevel()) + { + if (!w->IsEnabled()) + return true; + w = w->GetParent(); + } + return false; +} + void wxWindowMac::SetFocus() { if ( !AcceptsFocus() ) return ; + if (wxIsWindowOrParentDisabled((wxWindow*) this)) + return; + wxWindow* former = FindFocus() ; if ( former == this ) return ;