tdf#152173 Don't display tooltip windows when mousing over non-key windows

Don't display tooltips when mousing over non-key windows even if the
application is active as the tooltip window will pull the non-key
window in front of the key window.

Change-Id: I425b9af09de0272ebee84a218e2e5ae8c200a4e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151614
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index c26af90..82283d2 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -462,7 +462,10 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
    // parent window (to ensure that the tooltip is above the parent window),
    // displaying a tooltip pulls the parent window in front of the windows
    // of all other inactive applications.
    if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP) && ![NSApp isActive])
    // Also, don't display tooltips when mousing over non-key windows even if
    // the application is active as the tooltip window will pull the non-key
    // window in front of the key window.
    if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP) && (![NSApp isActive] || (mpParent && ![ mpParent->mpNSWindow isKeyWindow])))
        return;

    mbShown = bVisible;