[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 28 08:07:23 UTC 2018


 vcl/source/window/winproc.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit c5000631d3570af93a66d7aa12f78979a14344a5
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Nov 26 16:34:10 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Nov 28 09:06:55 2018 +0100

    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 f21d2b48bd68424a96aa6cd5572e368208378291)
    
    Change-Id: I4321e8e3fa1d3f8976c0a1fa29c6a182972023bf
    Reviewed-on: https://gerrit.libreoffice.org/64117
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 247b6443e366..7a54ea209268 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1843,6 +1843,11 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
     vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
     if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
         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


More information about the Libreoffice-commits mailing list