1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-24 05:33:50 +03:00

fixed, screenForContainment

This commit is contained in:
Johan Smith Agudelo Rodriguez 2016-12-25 19:10:52 -05:00
parent 8e16b1fded
commit 6d6b8574ac

View File

@ -134,16 +134,10 @@ QList<Plasma::Types::Location> NowDockCorona::freeEdges(int screen) const
int NowDockCorona::screenForContainment(const Plasma::Containment *containment) const
{
return 0;
while (const auto *parentCont = qobject_cast<const Plasma::Applet *>(containment->parent())) {
if (parentCont->isContainment())
containment = qobject_cast<const Plasma::Containment *>(parentCont);
}
for (auto *view : m_containments) {
if (view && view->containment() == containment)
return containment->screen();
if (view && view->containment() && view->containment()->id() == containment->id())
if (view->screen())
return qGuiApp->screens().indexOf(view->screen());
}
return -1;