From 90ad82b21dc2902b63707ab0fb8367dd47909412 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 1 Aug 2022 16:09:54 +1000 Subject: Avoid crash when point of autocompletion not on any screen by assuming the primary screen. --- qt/ScintillaEditBase/PlatQt.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index b2a298f03..6c2cdfd8e 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -790,6 +790,9 @@ QRect ScreenRectangleForPoint(QPoint posGlobal) { #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) const QScreen *screen = QGuiApplication::screenAt(posGlobal); + if (!screen) { + screen = QGuiApplication::primaryScreen(); + } return screen->availableGeometry(); #else const QDesktopWidget *desktop = QApplication::desktop(); -- cgit v1.2.3