Implement high DPI support in KWin QPA
Summary: Basically just a copy and paste from the relevant Qt Wayland parts. Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5172
This commit is contained in:
parent
44a6050e83
commit
8ef184e1cd
2 changed files with 7 additions and 1 deletions
|
@ -50,7 +50,7 @@ QImage::Format Screen::format() const
|
|||
|
||||
QRect Screen::geometry() const
|
||||
{
|
||||
return m_output ? m_output->geometry() : QRect(0, 0, 1, 1);
|
||||
return m_output ? QRect(m_output->globalPosition(), m_output->pixelSize() / m_output->scale()) : QRect(0, 0, 1, 1);
|
||||
}
|
||||
|
||||
QSizeF Screen::physicalSize() const
|
||||
|
@ -73,5 +73,10 @@ QDpi Screen::logicalDpi() const
|
|||
return QPlatformScreen::logicalDpi();
|
||||
}
|
||||
|
||||
qreal Screen::devicePixelRatio() const
|
||||
{
|
||||
return m_output ? (qreal)m_output->scale() : 1.0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
QSizeF physicalSize() const override;
|
||||
QPlatformCursor *cursor() const override;
|
||||
QDpi logicalDpi() const override;
|
||||
qreal devicePixelRatio() const override;
|
||||
|
||||
private:
|
||||
QPointer<KWayland::Client::Output> m_output;
|
||||
|
|
Loading…
Reference in a new issue