tdf#157565 show tooltip if any parent window is the key window
Commit b69db38a38b09e158e8d46d8b717db85860ca874 caused tooltips
to fail to appear if their immediate parent window was not the
key window. So, look through the parent window's parent windows
and, if any of those windows are the kwy window, show the tooltip.
Change-Id: Icf1aed1144fdeac03b4b208de8ed8ee2db8ad4a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158212
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
(cherry picked from commit f2b3e97b4068c3c9799a5c2efd9118200ec7dd15)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158160
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index a82cf9d..209f0b9 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -468,8 +468,29 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
// 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;
if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP))
{
if (![NSApp isActive])
return;
if (mpParent)
{
// tdf#157565 show tooltip if any parent window is the key window
bool bKeyWindowFound = false;
NSWindow *pParent = mpParent->mpNSWindow;
while (pParent)
{
if ([pParent isKeyWindow])
{
bKeyWindowFound = true;
break;
}
pParent = [pParent parentWindow];
}
if (!bKeyWindowFound)
return;
}
}
mbShown = bVisible;
if(bVisible)