include/vcl/vclenum.hxx | 3 ++- vcl/source/window/dockmgr.cxx | 6 ++---- vcl/source/window/floatwin.cxx | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-)
New commits: commit 70642bb7afd2cee6f7ae6eff2936a35978bd0597 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Apr 6 15:07:15 2023 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Apr 7 10:13:18 2023 +0200 tdf#154470 try moving the Show of the client to after the float positioning Change-Id: I785120bdad1a3c3311aeca0c8ec5b8b014999872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150108 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index 11fa32791a5f..75437f8772e5 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -341,10 +341,11 @@ enum class FloatWinPopupFlags NoMouseUpClose = 0x000200, GrabFocus = 0x000400, NoHorzPlacement = 0x000800, + MakeClientWindowVisibleBeforePopup = 0x001000, }; namespace o3tl { - template<> struct typed_flags<FloatWinPopupFlags> : is_typed_flags<FloatWinPopupFlags, 0x0fff> {}; + template<> struct typed_flags<FloatWinPopupFlags> : is_typed_flags<FloatWinPopupFlags, 0x1fff> {}; } // Flags for Window::Show() diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 3ab98c596183..d64f7cd8f208 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -821,8 +821,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin if( pParentToolBox->IsKeyEvent() ) nFlags |= FloatWinPopupFlags::GrabFocus; - GetWindow()->Show(true, ShowFlags::NoFocusChange | ShowFlags::NoActivate); - mpFloatWin->StartPopupMode( pParentToolBox, nFlags ); + mpFloatWin->StartPopupMode( pParentToolBox, nFlags | FloatWinPopupFlags::MakeClientWindowVisibleBeforePopup); if( pParentToolBox->IsKeyEvent() ) { @@ -839,8 +838,7 @@ void ImplDockingWindowWrapper::StartPopupMode( const tools::Rectangle& rRect, Fl return; ImplPreparePopupMode(); - GetWindow()->Show(true, ShowFlags::NoFocusChange | ShowFlags::NoActivate); - mpFloatWin->StartPopupMode( rRect, nFlags ); + mpFloatWin->StartPopupMode( rRect, nFlags | FloatWinPopupFlags::MakeClientWindowVisibleBeforePopup); } IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd, FloatingWindow*, void) diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 6fd221b4f0ca..7455a3bbb90c 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -795,6 +795,21 @@ void FloatingWindow::StartPopupMode( const tools::Rectangle& rRect, FloatWinPopu SetPosPixel( mpImplData->maPos ); ImplGetFrame()->PositionByToolkit(rRect, nFlags); + /* + tdf#140762 tdf#152671 Make dock win visible before showing popup + + Make them visible again *before* starting popup mode for the floating + window. This e.g. makes NVDA announce popups in the toolbar or the Calc + autofilter dropdown. + */ + if (nFlags & FloatWinPopupFlags::MakeClientWindowVisibleBeforePopup) + { + if (vcl::Window* pClientWindow = ImplGetClientWindow()) + { + pClientWindow->Show(true, ShowFlags::NoFocusChange | ShowFlags::NoActivate); + } + } + // set data and display window // convert maFloatRect to absolute device coordinates // so they can be compared across different frames