From 7e72aee474917a3b7f70d0666fbfdc90e060f70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 24 Sep 2015 14:23:59 +0200 Subject: [PATCH] return sane screen geometry on missing randr may help in the xinerama case, follow up to https://git.reviewboard.kde.org/r/125074/ REVIEW: 125456 --- screens_xrandr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/screens_xrandr.cpp b/screens_xrandr.cpp index 4063846ead..2b56346937 100644 --- a/screens_xrandr.cpp +++ b/screens_xrandr.cpp @@ -38,6 +38,7 @@ void XRandRScreens::update() auto fallback = [this]() { m_geometries << QRect(); m_refreshRates << -1.0f; + m_names << "Xinerama"; setCount(1); }; m_geometries.clear(); @@ -124,7 +125,8 @@ QRect XRandRScreens::geometry(int screen) const if (screen >= m_geometries.size() || screen < 0) { return QRect(); } - return m_geometries.at(screen); + return m_geometries.at(screen).isValid() ? m_geometries.at(screen) : + QRect(0, 0, displayWidth(), displayHeight()); // xinerama, lacks RandR } QString XRandRScreens::name(int screen) const