restore availableScreenRect behavior

--when an id is sent that is not contained
at stored screens then the primary screen
geometry is used instead
v0.6
Michail Vourlakos 8 years ago
parent d71cabb016
commit 367faf6bfa

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

Loading…
Cancel
Save