diff options
author | Patrick Luby <plubius@neooffice.org> | 2023-10-19 16:32:33 -0400 |
---|---|---|
committer | Patrick Luby <plubius@neooffice.org> | 2023-10-20 02:20:42 +0200 |
commit | fb68f0761c3cfadf73f261d2d44de7b4e277e0af (patch) | |
tree | ca1a5d8627f89a4877589f2d96e8735dc312b3b3 /vcl/osx | |
parent | 34ac12dca3f5af50fddfb7c77e2943897980b815 (diff) |
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>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salframe.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 98c165d9659f..d20e6e3d8422 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) |