From 5619a2939a1354804c1d89c07004ac832078be84 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 4 Apr 2021 20:15:52 +0300 Subject: [PATCH] wayland: Send only current wl_output mode --- src/waylandoutput.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/waylandoutput.cpp b/src/waylandoutput.cpp index f4d4d626c4..7fa60ea853 100644 --- a/src/waylandoutput.cpp +++ b/src/waylandoutput.cpp @@ -84,25 +84,13 @@ WaylandOutput::WaylandOutput(AbstractWaylandOutput *output, QObject *parent) m_waylandOutput->setDpmsSupported(output->capabilities() & AbstractWaylandOutput::Capability::Dpms); m_waylandOutput->setGlobalPosition(geometry.topLeft()); m_waylandOutput->setScale(std::ceil(output->scale())); + m_waylandOutput->setMode(output->modeSize(), output->refreshRate()); m_xdgOutputV1->setName(output->name()); m_xdgOutputV1->setDescription(output->description()); m_xdgOutputV1->setLogicalPosition(geometry.topLeft()); m_xdgOutputV1->setLogicalSize(geometry.size()); - const auto modes = output->modes(); - for (const AbstractWaylandOutput::Mode &mode : modes) { - KWaylandServer::OutputInterface::ModeFlags flags; - if (mode.flags & AbstractWaylandOutput::ModeFlag::Current) { - flags |= KWaylandServer::OutputInterface::ModeFlag::Current; - } - if (mode.flags & AbstractWaylandOutput::ModeFlag::Preferred) { - flags |= KWaylandServer::OutputInterface::ModeFlag::Preferred; - } - - m_waylandOutput->addMode(mode.size, flags, mode.refreshRate); - } - m_waylandOutput->done(); m_xdgOutputV1->done(); @@ -138,7 +126,7 @@ void WaylandOutput::update() m_waylandOutput->setGlobalPosition(geometry.topLeft()); m_waylandOutput->setScale(std::ceil(m_platformOutput->scale())); m_waylandOutput->setTransform(kwinTransformToOutputTransform(m_platformOutput->transform())); - m_waylandOutput->setCurrentMode(m_platformOutput->modeSize(), m_platformOutput->refreshRate()); + m_waylandOutput->setMode(m_platformOutput->modeSize(), m_platformOutput->refreshRate()); m_xdgOutputV1->setLogicalPosition(geometry.topLeft()); m_xdgOutputV1->setLogicalSize(geometry.size());