fix x11 strut partial error

Change-Id: Ife73758e917a3827e26895c342f62233edd46cb4
This commit is contained in:
石博文 2016-07-18 20:01:03 +08:00 committed by Hualet Wang
parent f55a604c3b
commit 19c1a8a5ed
4 changed files with 11 additions and 3 deletions

View File

@ -42,7 +42,8 @@ void DockPopupWindow::mousePressEvent(QMouseEvent *e)
void DockPopupWindow::globalMouseRelease()
{
Q_ASSERT(m_model);
if (!m_model)
return;
const QRect rect = QRect(pos(), size());
const QPoint pos = QCursor::pos();

View File

@ -127,6 +127,11 @@ int DockSettings::screenHeight() const
return m_displayInter->screenHeight();
}
int DockSettings::screenWidth() const
{
return m_displayInter->screenWidth();
}
bool DockSettings::autoHide() const
{
return m_autoHide;

View File

@ -29,6 +29,7 @@ public:
HideState hideState() const;
Position position() const;
int screenHeight() const;
int screenWidth() const;
bool autoHide() const;
const QRect primaryRect() const;
const QSize windowSize() const;

View File

@ -220,6 +220,7 @@ void MainWindow::setStrutPartial()
const Position side = m_settings->position();
const int maxScreenHeight = m_settings->screenHeight();
const int maxScreenWidth = m_settings->screenWidth();
XcbMisc::Orientation orientation = XcbMisc::OrientationTop;
uint strut = 0;
@ -244,13 +245,13 @@ void MainWindow::setStrutPartial()
break;
case Position::Left:
orientation = XcbMisc::OrientationLeft;
strut = r.width();
strut = r.right() + 1;
strutStart = r.top();
strutEnd = r.bottom();
break;
case Position::Right:
orientation = XcbMisc::OrientationRight;
strut = r.width();
strut = maxScreenWidth - r.left();
strutStart = r.top();
strutEnd = r.bottom();
break;