Commit 9ccae5ed authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

platforms/wayland: Round up fractional scale factors

Currently, fractional scale factors that are less than 1 will be floored
to 0, which is a protocol violation.

CCBUG: 432766
parent 2ce49877
......@@ -313,7 +313,7 @@ void EglWaylandBackend::presentOnSurface(EglWaylandOutput *output, const QRegion
WaylandOutput *waylandOutput = output->m_waylandOutput;
waylandOutput->surface()->setupFrameCallback();
waylandOutput->surface()->setScale(waylandOutput->scale());
waylandOutput->surface()->setScale(std::ceil(waylandOutput->scale()));
  • This broke build on FreeBsd :/

    13:32:07  /usr/home/jenkins/workspace/Plasma/kwin/kf5-qt5 FreeBSDQt5.15/src/plugins/platforms/wayland/egl_wayland_backend.cpp:316:45: error: no member named 'ceil' in namespace 'std'
    13:32:07      waylandOutput->surface()->setScale(std::ceil(waylandOutput->scale()));
    13:32:07                                         ~~~~~^
    13:32:07  /usr/home/jenkins/workspace/Plasma/kwin/kf5-qt5 FreeBSDQt5.15/src/plugins/platforms/wayland/egl_wayland_backend.cpp:376:63: warning: unused parameter 'renderedRegion' [-Wunused-parameter]
    13:32:07  void EglWaylandBackend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion)
    13:32:07                                                                ^
    13:32:08  1 warning and 1 error generated.

    https://build.kde.org/job/Plasma/job/kwin/job/kf5-qt5%20FreeBSDQt5.15/808/console

  • That's what CI is for, but it would be nice to have gitlab pipelines so we catch these issues during code review stage not after.

  • Totally agree, pre-merge builds are such a great quality garantee.

Please register or sign in to reply
Q_EMIT waylandOutput->outputChange(damage);
if (supportsSwapBuffersWithDamage() && !output->m_damageHistory.isEmpty()) {
......
......@@ -18,6 +18,8 @@
#include <KWayland/Client/shm_pool.h>
#include <KWayland/Client/surface.h>
#include <cmath>
namespace KWin
{
namespace Wayland
......@@ -86,7 +88,7 @@ void WaylandQPainterOutput::present(const QRegion &damage)
auto s = m_waylandOutput->surface();
s->attachBuffer(m_buffer);
s->damage(damage);
s->setScale(m_waylandOutput->scale());
s->setScale(std::ceil(m_waylandOutput->scale()));
s->commit();
}
......
......@@ -114,7 +114,7 @@ void WaylandCursor::doInstallImage(wl_buffer *image, const QSize &size, qreal sc
void WaylandCursor::drawSurface(wl_buffer *image, const QSize &size, qreal scale)
{
m_surface->attachBuffer(image);
m_surface->setScale(scale);
m_surface->setScale(std::ceil(scale));
m_surface->damageBuffer(QRect(QPoint(0, 0), size));
m_surface->commit(Surface::CommitFlag::None);
m_backend->flush();
......
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