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
This commit is contained in:
Thomas Lübking 2015-09-24 14:23:59 +02:00
parent ed2314dfbe
commit 7e72aee474

View file

@ -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