From 221b52d01a87a5bcbf52c5e51dba297c5666e504 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 6 Apr 2022 12:47:25 +0200 Subject: [PATCH] Core: fix OptionsPopup positioning Do not limit the popups coordinates to positive y coordinates, since Monitors above the main monitor have a negative y coordinate. Use the the available geometry of the parent widgets screen to check for sensible coordinates instead. Fixes: QTCREATORBUG-27341 Change-Id: I6e1572f7b2d3c83feafcf71392e265e14e6b457d Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller --- src/plugins/coreplugin/find/optionspopup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/find/optionspopup.cpp b/src/plugins/coreplugin/find/optionspopup.cpp index 532bd22390d..ab383b6e7b8 100644 --- a/src/plugins/coreplugin/find/optionspopup.cpp +++ b/src/plugins/coreplugin/find/optionspopup.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include using namespace Utils; @@ -64,7 +65,8 @@ OptionsPopup::OptionsPopup(QWidget *parent, const QVector &commands) layout->addWidget(checkBox); } const QPoint globalPos = parent->mapToGlobal(QPoint(0, -sizeHint().height())); - move(globalPos.x(), std::max(globalPos.y(), 0)); + const QRect screenGeometry = parent->screen()->availableGeometry(); + move(globalPos.x(), std::max(globalPos.y(), screenGeometry.y())); } bool OptionsPopup::event(QEvent *ev)