From 47adeb14b9dd1afcf7a9e113bf36ac9aa6a6d411 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 Jun 2020 02:48:03 +0200 Subject: [PATCH] Remove unnecessary Mac-specific IsShownOnScreen() implementation It ended up returning the result of the base class method anyhow, just after doing a lot of unnecessary work, so this commit shouldn't change anything, but should significantly speed up this function. We may want to explore the possibility of implementing this method natively using GetPeer()->IsVisible() later, as it could be faster than our own implementation, but we need to ensure that this always returns the same result as before, which might not be the case when the TLW is in the process of being shown or hidden, so don't do this for now. Closes https://github.com/wxWidgets/wxWidgets/pull/1911 Closes #18645. --- include/wx/osx/window.h | 2 -- src/osx/window_osx.cpp | 23 ----------------------- 2 files changed, 25 deletions(-) diff --git a/include/wx/osx/window.h b/include/wx/osx/window.h index 46ab294af7..2b14153541 100644 --- a/include/wx/osx/window.h +++ b/include/wx/osx/window.h @@ -72,8 +72,6 @@ public: return OSXShowWithEffect(false, effect, timeout); } - virtual bool IsShownOnScreen() const wxOVERRIDE; - virtual void SetFocus() wxOVERRIDE; virtual void WarpPointer( int x, int y ) wxOVERRIDE; diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index e53690f4a9..beccd49723 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -2418,29 +2418,6 @@ wxByte wxWindowMac::GetTransparent() const return m_macAlpha ; } -bool wxWindowMac::IsShownOnScreen() const -{ - if ( GetPeer() && GetPeer()->IsOk() ) - { - bool peerVis = GetPeer()->IsVisible(); - bool wxVis = wxWindowBase::IsShownOnScreen(); - if( peerVis != wxVis ) - { - // CS : put a breakpoint here to investigate differences - // between native an wx visibilities - // the only place where I've encountered them until now - // are the hiding/showing sequences where the vis-changed event is - // first sent to the innermost control, while wx does things - // from the outmost control - wxVis = wxWindowBase::IsShownOnScreen(); - return wxVis; - } - - return GetPeer()->IsVisible(); - } - return wxWindowBase::IsShownOnScreen(); -} - #if wxUSE_HOTKEY && wxOSX_USE_COCOA_OR_CARBON OSStatus