mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix frontend window rect error
Change-Id: Ic6bf6ee78f1083c630146f8c348408c87139a2c3
This commit is contained in:
parent
980dd64ca3
commit
6d0999fddc
Notes:
Deepin Code Review
2017-12-15 16:58:21 +08:00
Verified+1: Anonymous Coward #1000004 Verified+1: <yefei@linuxdeepin.com> Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Fri, 15 Dec 2017 16:58:21 +0800 Reviewed-on: https://cr.deepin.io/29456 Project: dde/dde-dock Branch: refs/heads/master
@ -36,6 +36,8 @@
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
extern const QPoint rawXPosition(const QPoint &scaledPos);
|
||||
|
||||
DockSettings::DockSettings(QWidget *parent)
|
||||
: QObject(parent),
|
||||
|
||||
@ -434,16 +436,13 @@ void DockSettings::primaryScreenChanged()
|
||||
void DockSettings::resetFrontendGeometry()
|
||||
{
|
||||
const QRect r = windowRect(m_position);
|
||||
|
||||
const qreal ratio = qApp->devicePixelRatio();
|
||||
|
||||
const int x = r.x();
|
||||
const int y = r.y();
|
||||
const QPoint p = rawXPosition(r.topLeft());
|
||||
const uint w = r.width() * ratio;
|
||||
const uint h = r.height() * ratio;
|
||||
|
||||
m_frontendRect = QRect(x, y, w, h);
|
||||
m_dockInter->SetFrontendWindowRect(x, y, w, h);
|
||||
m_frontendRect = QRect(p.x(), p.y(), w, h);
|
||||
m_dockInter->SetFrontendWindowRect(p.x(), p.y(), w, h);
|
||||
}
|
||||
|
||||
bool DockSettings::test(const Position pos, const QList<QRect> &otherScreens) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user