summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-11 12:41:58 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-03-11 17:19:25 +0100
commit643a1492bd648fbd803ca86aca600cc2bdaf5819 (patch)
tree62a944247c23949715b91c0cd22a0510a338bc9d
parent1a3d18ecaabec6f7b8f0f615df2222a6687d2224 (diff)
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@CIB.de>
-rw-r--r--vcl/source/window/menu.cxx7
1 files changed, 7 insertions, 0 deletions
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;