vcl/inc/svdata.hxx | 3 +++ vcl/source/control/imp_listbox.cxx | 2 +- vcl/unx/gtk3/gtkframe.cxx | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-)
New commits: commit 698935c220131bc761eb9cf25e01fa91087a788e Author: László Németh <[email protected]> AuthorDate: Mon Nov 6 23:56:57 2023 +0100 Commit: László Németh <[email protected]> CommitDate: Tue Nov 7 07:16:01 2023 +0100 tdf#152155 vcl: fix gtk popup listbox positions on sidebar It was fixed only on Wayland previously. Follow-up to commit 15cdee0d846854b50dd04626b73499bef9305e00 "Resolves: tdf#152155 use gtk's knowledge of relative widget positions". Change-Id: I7a8b17189b319146142a2193ec4b5ec41e2c2d27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159020 Tested-by: Jenkins Reviewed-by: László Németh <[email protected]> diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 104b9543b74a..fd7ae855b5f2 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -118,6 +118,9 @@ class UITestLogger; #define SV_ICON_ID_DATABASE 12 #define SV_ICON_ID_FORMULA 13 +const FloatWinPopupFlags LISTBOX_FLOATWINPOPUPFLAGS = FloatWinPopupFlags::Down | + FloatWinPopupFlags::NoHorzPlacement | FloatWinPopupFlags::AllMouseButtonClose; + namespace com::sun::star::datatransfer::clipboard { class XClipboard; } namespace vcl diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 04919ca26f20..bb4da51859b0 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -3011,7 +3011,7 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking ) pGrandparentOutDev->ReMirror( aRect ); // mouse-button right: close the List-Box-Float-win and don't stop the handling fdo#84795 - StartPopupMode( aRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::NoHorzPlacement | FloatWinPopupFlags::AllMouseButtonClose ); + StartPopupMode( aRect, LISTBOX_FLOATWINPOPUPFLAGS ); if( nPos != LISTBOX_ENTRY_NOTFOUND ) mpImplLB->ShowProminentEntry( nPos ); diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index b1bf8474b1b2..f063f80b7dea 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -3091,8 +3091,12 @@ void GtkSalFrame::EndSetClipRegion() void GtkSalFrame::PositionByToolkit(const tools::Rectangle& rRect, FloatWinPopupFlags nFlags) { - if (ImplGetSVData()->maNWFData.mbCanDetermineWindowPosition) + if ( ImplGetSVData()->maNWFData.mbCanDetermineWindowPosition && + // tdf#152155 cannot determine window positions of popup listboxes on sidebar + nFlags != LISTBOX_FLOATWINPOPUPFLAGS ) + { return; + } m_aFloatRect = rRect; m_nFloatFlags = nFlags;
