summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-03-29 20:57:07 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-03-30 09:03:42 +0200
commitd4ed266849b558b041acb740a18bd81fa39bc582 (patch)
treecd0fc8ba91c425a965c03ceae65fc4ba1884acc3
parenta247d2f896d7fcb30f35cf95f69e32534a475fba (diff)
tdf#133350 vcl focus loss: fix unwanted cancel of non-menu popup
Regression from commit f21d2b48bd68424a96aa6cd5572e368208378291 (tdf#121723 vcl: leave popup mode on focus loss of toplevel windows, 2018-11-26), the original motivation was to cancel menu popus (toplevel window menus, context menus). Fix the unwanted cancel of ImplPopupFloatWin/ImplListBoxFloatingWindow by restricting the cancel to menu floating windows. This keeps the original bug fixed and allows setting e.g. the font size in the toolbar's popup part. Change-Id: Ida503d0c13dc5a96287bfa31b6c2ce9d4a53e940 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113326 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--vcl/source/window/winproc.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 3f94d112b751..03c73072c5a5 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1898,8 +1898,10 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
// Make sure that no menu is visible when a toplevel window loses focus.
VclPtr<FloatingWindow> pFirstFloat = pSVData->mpWinData->mpFirstFloat;
- if (pFirstFloat && !pWindow->GetParent())
+ if (pFirstFloat && pFirstFloat->IsMenuFloatingWindow() && !pWindow->GetParent())
+ {
pFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
+ }
}
namespace {