mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix x11 strut partial error
Change-Id: Ife73758e917a3827e26895c342f62233edd46cb4
This commit is contained in:
parent
f55a604c3b
commit
19c1a8a5ed
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user