restore availableScreenRect behavior

--when an id is sent that is not contained
at stored screens then the primary screen
geometry is used instead
pull/1/head
Michail Vourlakos 8 years ago
parent fa2da5ceb1
commit 3542a3e66c

@ -316,11 +316,10 @@ QRegion DockCorona::availableScreenRegion(int id) const
QRect DockCorona::availableScreenRect(int id) const QRect DockCorona::availableScreenRect(int id) const
{ {
if (!m_screenPool->knownIds().contains(id))
return {};
const auto screens = qGuiApp->screens(); const auto screens = qGuiApp->screens();
const QScreen *screen{qGuiApp->primaryScreen()}; const QScreen *screen{qGuiApp->primaryScreen()};
if (m_screenPool->knownIds().contains(id)) {
QString scrName = m_screenPool->connector(id); QString scrName = m_screenPool->connector(id);
foreach (auto scr, screens) { foreach (auto scr, screens) {
@ -329,6 +328,7 @@ QRect DockCorona::availableScreenRect(int id) const
break; break;
} }
} }
}
if (!screen) if (!screen)
return {}; return {};

Loading…
Cancel
Save