With a multiscreen setup and Qt6, make sure to get the geometry
of the screen containing the widget.
#include <QStyleOptionFrame>
#include <QMouseEvent>
#include <QVBoxLayout>
+#include <QWindow>
namespace lyx {
namespace frontend {
#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());