Commit fa3126f7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Improve how we figure out the screenGeometry for a screen

Leverage on the vector position rather than looking through it, this way
it works even before the containment is set.

CCBUG: 335710
parent d70dfd2c
......@@ -370,9 +370,15 @@ void ShellCorona::screenInvariants() const
}
QSet<QScreen*> screens;
int i = 0;
foreach(DesktopView *view, d->views) {
Q_ASSERT(!screens.contains(view->screen()));
Q_ASSERT(view->isVisible());
Q_ASSERT(view->fillScreen());
screens.insert(view->screen());
Q_ASSERT(view->containment()->screen() == i);
++i;
}
}
......@@ -447,13 +453,7 @@ int ShellCorona::numScreens() const
QRect ShellCorona::screenGeometry(int id) const
{
DesktopView *view = 0;
foreach (DesktopView *v, d->views) {
if (v->containment() && v->containment()->screen() == id) {
view = v;
break;
}
}
DesktopView *view = d->views[id];
if (view) {
return view->geometry();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment