diff --git a/src/renderer/qt/qt_window_manager.cc b/src/renderer/qt/qt_window_manager.cc index 55f6acbf6..0aceecce6 100644 --- a/src/renderer/qt/qt_window_manager.cc +++ b/src/renderer/qt/qt_window_manager.cc @@ -417,7 +417,15 @@ bool QtWindowManager::ShouldShowInfolistWindow( Rect QtWindowManager::GetMonitorRect(int x, int y) { QPoint point{x, y}; - return GetRect(QGuiApplication::screenAt(point)->geometry()); + const QScreen *screen = QGuiApplication::screenAt(point); + if (screen == nullptr) { + // (x, y) does not belong to any screen. Fall back to the primary screen. + // TODO: Return the nearest monitor rect instead. + // c.f. GetWorkingAreaFromPointImpl in win32_renderer_util.cc. + return GetRect(QGuiApplication::primaryScreen()->geometry()); + } + + return GetRect(screen->geometry()); } void QtWindowManager::UpdateInfolistWindow(