From 37ca3bcae96ce009d64a7a9bdc476971c85c9ced Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Oct 2019 01:30:43 +0200 Subject: [PATCH] Remove unnecessary wxIsWindowOrParentDisabled() wxWindow::IsEnabled() already returns false if any of the window ancestors are disabled, there is no need to check them explicitly. --- src/osx/window_osx.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 533e0bbf4c..f3c4260ac7 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -565,20 +565,9 @@ 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 (wxIsWindowOrParentDisabled((wxWindow*) this)) + if ( !IsEnabled() ) return; wxWindow* former = FindFocus() ;