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.
This commit is contained in:
Vadim Zeitlin
2020-06-28 02:48:03 +02:00
parent b7bfe53bed
commit 47adeb14b9
2 changed files with 0 additions and 25 deletions

View File

@@ -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;

View File

@@ -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