Kaydet (Commit) c5000631 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#121723 vcl: leave popup mode on focus loss of toplevel windows

This way it can't happen that we open a menu or context menu, the user
switches away (loosing focus) and a leftover floating window is still
there.

Handle this at the same place where we stop blinking the cursor on focus
loss.

(cherry picked from commit f21d2b48)

Change-Id: I4321e8e3fa1d3f8976c0a1fa29c6a182972023bf
Reviewed-on: https://gerrit.libreoffice.org/64117
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 6a79872f
...@@ -1843,6 +1843,11 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow ) ...@@ -1843,6 +1843,11 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin; vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor ) if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide(); pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
// Make sure that no menu is visible when a toplevel window loses focus.
VclPtr<FloatingWindow> pFirstFloat = pSVData->maWinData.mpFirstFloat;
if (pFirstFloat && !pWindow->GetParent())
pFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
} }
struct DelayedCloseEvent struct DelayedCloseEvent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment