diff options
author | Neil <nyamatongwe@gmail.com> | 2022-08-01 16:09:54 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-08-01 16:09:54 +1000 |
commit | 90ad82b21dc2902b63707ab0fb8367dd47909412 (patch) | |
tree | 771b9d44b4855c65127b58fa312b895db0f8a5ad | |
parent | f785b350d7e0e632a1bc81c96fc0bd76cd013cbc (diff) | |
download | scintilla-mirror-90ad82b21dc2902b63707ab0fb8367dd47909412.tar.gz |
Avoid crash when point of autocompletion not on any screen by assuming the
primary screen.
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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(); |