Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7aedacd8 authored by David Edmundson's avatar David Edmundson

Fractional scaling in DRM kscreen integration

Summary:
The kwin code was written to treat scale as non integers, we just need
to switch to the relevant float version of methods.

Test Plan:
Used kscreen-doctor to change this
Konsole resized as appropriate
Plasmashell was all broken, but that's expected until QScreen::size is based on the
xdg-output virtual size

Reviewers: #kwin, mart, graesslin, romangg

Reviewed By: #kwin, mart, graesslin

Subscribers: romangg, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13616
parent 39186e14
......@@ -53,6 +53,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <xf86drmMode.h>
#include <libdrm/drm_mode.h>
#include <cmath>
namespace KWin
{
......@@ -817,10 +818,16 @@ void DrmOutput::setScale(qreal scale)
{
m_scale = scale;
if (m_waylandOutput) {
m_waylandOutput->setScale(scale);
// this is the scale that clients will ideally use for their buffers
// this has to be an int which is fine
// I don't know whether we want to round or ceil
// or maybe even set this to 3 when we're scaling to 1.5
// don't treat this like it's chosen deliberately
m_waylandOutput->setScale(std::ceil(scale));
}
if (m_waylandOutputDevice) {
m_waylandOutputDevice->setScale(scale);
m_waylandOutputDevice->setScaleF(scale);
}
if (m_xdgOutput) {
m_xdgOutput->setLogicalSize(pixelSize() / m_scale);
......@@ -861,7 +868,7 @@ bool DrmOutput::commitChanges()
}
if (m_changeset->scaleChanged()) {
qCDebug(KWIN_DRM) << "Setting scale:" << m_changeset->scale();
setScale(m_changeset->scale());
setScale(m_changeset->scaleF());
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment