diff --git a/src/osx/cocoa/preferences.mm b/src/osx/cocoa/preferences.mm index 2590bd24df..bbc13a1ff9 100644 --- a/src/osx/cocoa/preferences.mm +++ b/src/osx/cocoa/preferences.mm @@ -151,6 +151,10 @@ private: info->win->Show(); SetTitle(info->page->GetName()); + // Refresh the page to ensure everything is drawn in 10.14's dark mode; + // without it, generic controls aren't shown at all + info->win->Refresh(); + // TODO: Preferences window may have some pages resizeable and some // non-resizable on OS X; the whole window is or is not resizable // depending on which page is selected. diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index c33cd56dba..eaddbc7cad 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -3024,12 +3024,30 @@ void wxWidgetCocoaImpl::GetContentArea( int&left, int &top, int &width, int &hei } } +static void SetSubviewsNeedDisplay( NSView *view ) +{ + for ( NSView *sub in view.subviews ) + { + if ( !sub.layer ) + continue; + + [sub setNeedsDisplay:YES]; + SetSubviewsNeedDisplay(sub); + } +} + void wxWidgetCocoaImpl::SetNeedsDisplay( const wxRect* where ) { if ( where ) [m_osxView setNeedsDisplayInRect:wxToNSRect(m_osxView, *where )]; else [m_osxView setNeedsDisplay:YES]; + + // Layer-backed views (which are all in Mojave's Dark Mode) may not have + // their children implicitly redrawn with the parent. For compatibility, + // do it manually here: + if ( m_osxView.layer ) + SetSubviewsNeedDisplay(m_osxView); } bool wxWidgetCocoaImpl::GetNeedsDisplay() const