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

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 11 16:19:59 UTC 2020


 vcl/source/window/menu.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 643a1492bd648fbd803ca86aca600cc2bdaf5819
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Wed Mar 11 12:41:58 2020 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Mar 11 17:19:25 2020 +0100

    Add some fallback minimum size when screen size detection goes wrong
    
    Change-Id: I97ec2359b8ae406e310a5d043ac068ddd89b3fd1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90320
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index e2d2d91347b5..35fe8561e58e 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2932,6 +2932,13 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const tools::R
         nMaxHeight = std::min(nMaxHeight, std::max(nHeightAbove, nHeightBelow));
     }
 
+    // In certain cases this might be misdetected with a height of 0, leading to menus not being displayed.
+    // So assume that the available screen size matches at least the system requirements
+    SAL_WARN_IF(nMaxHeight < 768, "vcl",
+                "Available height misdetected as " << nMaxHeight
+                                                   << "px. Setting to 768px instead.");
+    nMaxHeight = std::max(nMaxHeight, 768l);
+
     if (pStartedFrom && pStartedFrom->IsMenuBar())
         nMaxHeight -= pW->GetSizePixel().Height();
     sal_Int32 nLeft, nTop, nRight, nBottom;


More information about the Libreoffice-commits mailing list