If the libreoffice-gtk library is loaded, the menu highlight colours are not correctly loaded from the GTK theme. The highlight colour itself is correct, but the foreground colour used by native GTK applications is ignored. The following patch fixes this and uses the correct text highlight colour: --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -3870,9 +3875,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) } aHighlightColor = getColor( pMenuItemStyle->bg[ GTK_STATE_SELECTED ] ); - aHighlightTextColor = getColor( pMenuTextStyle->fg[ GTK_STATE_PRELIGHT ] ); - if( aHighlightColor == aHighlightTextColor ) - aHighlightTextColor = (aHighlightColor.GetLuminance() < 128) ? Color( COL_WHITE ) : Color( COL_BLACK ); + aHighlightTextColor = getColor( pMenuItemStyle->fg[ GTK_STATE_SELECTED ] ); aStyleSet.SetMenuHighlightColor( aHighlightColor ); aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor ); However, this reveals another bug, which is that the highlight colour is also used for the menu header when active, which should not happen in a native GTK application. This is fixed by the following patch: --- vcl/source/window/menu.cxx +++ vcl/source/window/menu.cxx @@ -2642,6 +2642,8 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa { if ( bIsMenuBar && bRollover ) pWin->SetTextColor( rSettings.GetMenuBarRolloverTextColor() ); + else if ( bIsMenuBar ) + pWin->SetTextColor( rSettings.GetMenuBarTextColor() ); else if ( bHighlighted ) pWin->SetTextColor( rSettings.GetMenuHighlightTextColor() ); }
Confirming. Same comment as in bug 92244. Thank you again!
Now submitted to gerrit as https://gerrit.libreoffice.org/#/c/16856/
Simon Long committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ae4ec7a75b0048af2fba12953a84fe5b26d89b9a tdf#92243 Read menu highlight text colour correctly from GTK theme It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Simon Long committed a patch related to this issue. It has been pushed to "libreoffice-5-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=86deb192de0803b5c59a4b07590b3d725f22c089&h=libreoffice-5-0 tdf#92243 Read menu highlight text colour correctly from GTK theme It will be available in 5.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.