Fix strut error on duplicate mode

Change-Id: I0e614bb7b195fd9ba071ff7e764bd146a481119b
This commit is contained in:
石博文 2017-03-03 17:30:11 +08:00 committed by Deepin Code Review
parent 37cca04886
commit e5e5e46f08
Notes: Deepin Code Review 2017-03-06 09:23:16 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Verified+1: <yefei@linuxdeepin.com>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Mon, 06 Mar 2017 09:23:16 +0800
Reviewed-on: https://cr.deepin.io/21042
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -333,13 +333,18 @@ void MainWindow::setStrutPartial()
// pass if strut area is intersect with other screen
int count = 0;
const QRect pr = m_settings->primaryRect();
for (auto *screen : qApp->screens())
if (screen->geometry().intersects(strutArea))
{
const QRect sr = screen->geometry();
if (sr == pr)
continue;
if (sr.intersects(strutArea))
++count;
if (count > 1)
}
if (count > 0)
return;
else if (count != 1)
qWarning() << strutArea << p << r << count << orientation << strut << strutStart << strutEnd;
m_xcbMisc->set_strut_partial(winId(), orientation, strut, strutStart, strutEnd);
}