sfx2/source/appl/childwin.cxx       |    4 +++-
 vcl/unx/generic/window/salframe.cxx |   13 ++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 3bf0f94b373037fc662e617f936b57f9f317b142
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Sat Jan 15 17:44:31 2022 -0900
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Jan 26 16:05:06 2022 +0100

    tdf#146648 make find and replace dialog reopen at last position
    
    Makes the find and replace dialog reopen at the position it is closed/
    canceled.
    
    this may have begun to go wrong for X11 at:
    
    commit 8e2398bf72507324718e99fb2066c068c7898bf8
    Date:   Thu Jul 21 16:00:30 2011 +0200
    
        Remove supportsICCCMPos. Resize working with Sawfish anyway.
    
    Change-Id: I7bdcf5cd53dba8f3aacb1f2d1ae24f4bbcee26d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128473
    Tested-by: Jenkins
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 944fe47ed64a..ae8e7c35ad71 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -38,6 +38,8 @@
 #include <sfx2/dispatch.hxx>
 #include <workwin.hxx>
 
+#include <sfx2/sfxsids.hrc>
+
 const sal_uInt16 nVersion = 2;
 
 SfxChildWinFactory::SfxChildWinFactory( SfxChildWinCtor pTheCtor, sal_uInt16 
nID,
@@ -236,7 +238,7 @@ std::unique_ptr<SfxChildWindow> 
SfxChildWindow::CreateChildWindow( sal_uInt16 nI
             {
                 if ( pBindings )
                     pBindings->ENTERREGISTRATIONS();
-                SfxChildWinInfo aInfo = rFactInfo;
+                SfxChildWinInfo aInfo = nId == SID_SEARCH_DLG ? rInfo : 
rFactInfo;
                 Application::SetSystemWindowMode( 
SystemWindowFlags::NOAUTOMODE );
                 pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo );
                 Application::SetSystemWindowMode( nOldMode );
diff --git a/vcl/unx/generic/window/salframe.cxx 
b/vcl/unx/generic/window/salframe.cxx
index 00fd74693c9f..70803c7353e4 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -1676,14 +1676,18 @@ void X11SalFrame::SetWindowState( const SalFrameState 
*pState )
             if ((pState->mnMask & FRAMESTATE_MASK_GEOMETRY) != 
FRAMESTATE_MASK_GEOMETRY)
                 GetPosSize (aPosSize);
 
+            sal_uInt16 nPosFlags = 0;
+
             // change requested properties
             if (pState->mnMask & WindowStateMask::X)
             {
-                aPosSize.SetPosX (pState->mnX);
+                aPosSize.SetPosX(pState->mnX - (mpParent ? 
mpParent->maGeometry.nX : 0));
+                nPosFlags |= SAL_FRAME_POSSIZE_X;
             }
             if (pState->mnMask & WindowStateMask::Y)
             {
-                aPosSize.SetPosY (pState->mnY);
+                aPosSize.SetPosY(pState->mnY - (mpParent ? 
mpParent->maGeometry.nY : 0));
+                nPosFlags |= SAL_FRAME_POSSIZE_Y;
             }
             if (pState->mnMask & WindowStateMask::Width)
             {
@@ -1732,7 +1736,10 @@ void X11SalFrame::SetWindowState( const SalFrameState 
*pState )
                     aPosSize.Move( 0, 
static_cast<tools::Long>(aGeom.nTopDecoration) - aPosSize.Top() );
             }
 
-            SetPosSize( 0, 0, aPosSize.GetWidth(), aPosSize.GetHeight(), 
SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
+            SetPosSize(aPosSize.getX(), aPosSize.getY(),
+                       aPosSize.GetWidth(), aPosSize.GetHeight(),
+                       SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT |
+                       nPosFlags);
         }
     }
 

Reply via email to