fix transparency problems on macOS

under mojave any backgroundColor destroys transparency
This commit is contained in:
Stefan Csomor
2018-10-23 21:01:31 +02:00
parent 651e1cd1b5
commit a94325a76a
2 changed files with 7 additions and 3 deletions

View File

@@ -914,6 +914,11 @@ bool wxNonOwnedWindowCocoaImpl::SetTransparent(wxByte alpha)
bool wxNonOwnedWindowCocoaImpl::SetBackgroundColour(const wxColour& col )
{
// only set the native background color if the toplevel window's
// background is not supposed to be transparent, otherwise the
// transparency is lost
if( GetWXPeer()->GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT &&
!(GetWXPeer()->GetWindowStyle() & wxFRAME_SHAPED) )
[m_macWindow setBackgroundColor:col.OSXGetNSColor()];
return true;
}

View File

@@ -152,7 +152,6 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
wxWindowCreateEvent event(this);
HandleWindowEvent(event);
if ( GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT )
SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ));
if ( parent )