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

Fractional scaling in DRM kscreen integration

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:
parent 39186e14
......@@ -53,6 +53,7 @@ along with this program. If not, see <>.
#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) {
// 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
if (m_waylandOutputDevice) {
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();
return true;
Supports Markdown
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