[LyX/master] Amend 635a7d77

Enrico Forestieri forenr at lyx.org
Mon Mar 15 17:32:25 UTC 2021


commit 7cb2a10eb8dfc7b12b66351cf130397b3604afc1
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Mon Mar 15 18:35:58 2021 +0100

    Amend 635a7d77
    
    With a multiscreen setup and Qt6, make sure to get the geometry
    of the screen containing the widget.
---
 src/frontends/qt/IconPalette.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/IconPalette.cpp b/src/frontends/qt/IconPalette.cpp
index 3c5eb7a..8956a48 100644
--- a/src/frontends/qt/IconPalette.cpp
+++ b/src/frontends/qt/IconPalette.cpp
@@ -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());


More information about the lyx-cvs mailing list