[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 1 09:18:59 UTC 2018


 vcl/source/window/dockwin.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit ab58646b3eefcdee9e6ad786b8eed27390da4419
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Wed Oct 24 01:01:21 2018 -0800
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu Nov 1 10:18:27 2018 +0100

    Fix undocked window loses focus
    
    Use any method to undock a docked window and the window loses focus.
    This is a regression that began sometime after version 5.1.6.2
    
    Change-Id: I91194db3cc23a24e805a90edaf1566f950ac129d
    Reviewed-on: https://gerrit.libreoffice.org/62270
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index ec203fc743bf..53a40c35c752 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -532,6 +532,8 @@ bool DockingWindow::EventNotify( NotifyEvent& rNEvt )
                 if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) )
                 {
                     SetFloatingMode( !IsFloatingMode() );
+                    if ( IsFloatingMode() )
+                        ToTop( ToTopFlags::GrabFocusOnly );
                     return true;
                 }
                 else if ( pMEvt->GetClicks() == 1 )
@@ -561,6 +563,8 @@ bool DockingWindow::EventNotify( NotifyEvent& rNEvt )
                 rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled )
             {
                 SetFloatingMode( !IsFloatingMode() );
+                if ( IsFloatingMode() )
+                    ToTop( ToTopFlags::GrabFocusOnly );
                 return true;
             }
         }
@@ -587,12 +591,11 @@ void DockingWindow::EndDocking( const tools::Rectangle& rRect, bool bFloatMode )
 
     if ( !IsDockingCanceled() )
     {
-        bool bShow = false;
         if ( bFloatMode != IsFloatingMode() )
         {
-            Show( false, ShowFlags::NoFocusChange );
             SetFloatingMode( bFloatMode );
-            bShow = true;
+            if ( IsFloatingMode() )
+                ToTop( ToTopFlags::GrabFocusOnly );
             if ( bFloatMode && mpFloatWin )
                 mpFloatWin->SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() );
         }
@@ -602,9 +605,6 @@ void DockingWindow::EndDocking( const tools::Rectangle& rRect, bool bFloatMode )
             aPos = GetParent()->ScreenToOutputPixel( aPos );
             Window::SetPosSizePixel( aPos, rRect.GetSize() );
         }
-
-        if ( bShow )
-            Show();
     }
     mbDocking = false;
     mbDockCanceled = bOrigDockCanceled;


More information about the Libreoffice-commits mailing list