X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..306a5d95154602e34bd752aa18859931018d26d5:/src/osx/nonownedwnd_osx.cpp diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 7b8f08cedd..fc50ea4091 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -169,28 +169,32 @@ wxNonOwnedWindow::~wxNonOwnedWindow() // wxNonOwnedWindow misc // ---------------------------------------------------------------------------- -bool wxNonOwnedWindow::ShowWithEffect(wxShowEffect effect, - unsigned timeout ) +bool wxNonOwnedWindow::OSXShowWithEffect(bool show, + wxShowEffect effect, + unsigned timeout) { - if ( !wxWindow::Show(true) ) + // Cocoa code needs to manage window visibility on its own and so calls + // wxWindow::Show() as needed but if we already changed the internal + // visibility flag here, Show() would do nothing, so avoid doing it +#if wxOSX_USE_CARBON + if ( !wxWindow::Show(show) ) return false; +#endif // Carbon - // because apps expect a size event to occur at this moment - wxSizeEvent event(GetSize() , m_windowId); - event.SetEventObject(this); - HandleWindowEvent(event); - + if ( effect == wxSHOW_EFFECT_NONE || + !m_nowpeer || !m_nowpeer->ShowWithEffect(show, effect, timeout) ) + return Show(show); - return m_nowpeer->ShowWithEffect(true, effect, timeout); -} - -bool wxNonOwnedWindow::HideWithEffect(wxShowEffect effect, - unsigned timeout ) -{ - if ( !wxWindow::Show(false) ) - return false; + if ( show ) + { + // as apps expect a size event to occur when the window is shown, + // generate one when it is shown with effect too + wxSizeEvent event(GetSize(), m_windowId); + event.SetEventObject(this); + HandleWindowEvent(event); + } - return m_nowpeer->ShowWithEffect(false, effect, timeout); + return true; } wxPoint wxNonOwnedWindow::GetClientAreaOrigin() const