With a multiscreen setup and Qt6, make sure to get the geometry
of the screen containing the widget.
This commit is contained in:
Enrico Forestieri 2021-03-15 18:35:58 +01:00
parent 635a7d77dd
commit 7cb2a10eb8

View File

@ -27,6 +27,7 @@
#include <QStyleOptionFrame>
#include <QMouseEvent>
#include <QVBoxLayout>
#include <QWindow>
namespace lyx {
namespace frontend {
@ -181,7 +182,7 @@ void IconPalette::showEvent(QShowEvent * /*event*/)
#if QT_VERSION < 0x060000
QRect const screen = qApp->desktop()->availableGeometry(this);
#else
QRect const screen = qApp->primaryScreen()->availableGeometry();
QRect const screen = window()->windowHandle()->screen()->availableGeometry();
#endif
QPoint const gpos = parentWidget()->mapToGlobal(
parentWidget()->geometry().bottomLeft());