diff --git a/autotests/testscreenconfig.cpp b/autotests/testscreenconfig.cpp --- a/autotests/testscreenconfig.cpp +++ b/autotests/testscreenconfig.cpp @@ -156,7 +156,7 @@ QCOMPARE(output->type(), Output::HDMI); QCOMPARE(output->modes().count(), 4); QCOMPARE(output->pos(), QPoint(1280, 0)); - QCOMPARE(output->geometry(), QRect(1280, 0, 1920 / 1.4, 1080 / 1.4)); + QCOMPARE(output->geometry(), QRect(1280, 0, 1920, 1080)); QCOMPARE(output->currentModeId(), QLatin1String("4")); QCOMPARE(output->preferredModeId(), QLatin1String("4")); QCOMPARE(output->rotation(), Output::None); diff --git a/backends/kwayland/waylandoutput.cpp b/backends/kwayland/waylandoutput.cpp --- a/backends/kwayland/waylandoutput.cpp +++ b/backends/kwayland/waylandoutput.cpp @@ -148,7 +148,7 @@ mode->setId(modeid); mode->setRefreshRate(m.refreshRate); - mode->setSize(m.size); + mode->setSize(m.size / m_output->scale()); mode->setName(modename); if (m.flags.testFlag(KWayland::Client::OutputDevice::Mode::Flag::Current)) { currentModeId = modeid; diff --git a/src/output.h b/src/output.h --- a/src/output.h +++ b/src/output.h @@ -184,13 +184,15 @@ * Returns a rectangle containing the currently set output position and * size. * - * The geometry also reflects current orientation (i.e. if current mode + * The geometry reflects current orientation (i.e. if current mode * is 1920x1080 and orientation is @p KScreen::Output::Left, then the - * size of the returned rectangle will be 1080x1920. + * size of the returned rectangle will be 1080x1920) and current scale + * (i.e. if scale is 1.5 then geometry() of an output with mode 1920x1080 + * will be 2880x1620). * * This property contains the current settings stored in the particular - * Output object, so it is updated even when user changes current mode - * or orientation without applying the whole config/ + * Output object, so it is updated even when user changes current mode, + * orientation or scale without applying the whole config/ */ QRect geometry() const; diff --git a/src/output.cpp b/src/output.cpp --- a/src/output.cpp +++ b/src/output.cpp @@ -489,7 +489,7 @@ // actual rotation() set by caller, it's only updated when we get update from // KScreen, but not when user changes mode or rotation manually - QSize size = currentMode()->size() / d->scale; + QSize size = currentMode()->size() * d->scale; if (!isHorizontal()) { size = size.transposed(); }