Commit 925bb4ee authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Adapt to XdgOutputManagerV1 changes

parent 05e62f55
......@@ -15,7 +15,7 @@
// KWayland
#include <KWaylandServer/display.h>
#include <KWaylandServer/outputchangeset.h>
#include <KWaylandServer/xdgoutput_interface.h>
#include <KWaylandServer/xdgoutput_v1_interface.h>
// KF5
#include <KLocalizedString>
......@@ -30,7 +30,7 @@ AbstractWaylandOutput::AbstractWaylandOutput(QObject *parent)
{
m_waylandOutput = waylandServer()->display()->createOutput(this);
m_waylandOutputDevice = waylandServer()->display()->createOutputDevice(this);
m_xdgOutput = waylandServer()->xdgOutputManager()->createXdgOutput(m_waylandOutput, this);
m_xdgOutputV1 = waylandServer()->xdgOutputManagerV1()->createXdgOutput(m_waylandOutput, this);
connect(m_waylandOutput, &KWaylandServer::OutputInterface::dpmsModeRequested, this,
[this] (KWaylandServer::OutputInterface::DpmsMode mode) {
......@@ -81,8 +81,8 @@ void AbstractWaylandOutput::setGlobalPos(const QPoint &pos)
m_waylandOutputDevice->setGlobalPosition(pos);
m_waylandOutput->setGlobalPosition(pos);
m_xdgOutput->setLogicalPosition(pos);
m_xdgOutput->done();
m_xdgOutputV1->setLogicalPosition(pos);
m_xdgOutputV1->done();
}
QSize AbstractWaylandOutput::modeSize() const
......@@ -111,8 +111,8 @@ void AbstractWaylandOutput::setScale(qreal scale)
// 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));
m_xdgOutput->setLogicalSize(pixelSize() / scale);
m_xdgOutput->done();
m_xdgOutputV1->setLogicalSize(pixelSize() / scale);
m_xdgOutputV1->done();
}
using DeviceInterface = KWaylandServer::OutputDeviceInterface;
......@@ -147,8 +147,8 @@ void AbstractWaylandOutput::setTransform(DeviceInterface::Transform transform)
m_waylandOutputDevice->setTransform(transform);
m_waylandOutput->setTransform(toOutputTransform(transform));
m_xdgOutput->setLogicalSize(pixelSize() / scale());
m_xdgOutput->done();
m_xdgOutputV1->setLogicalSize(pixelSize() / scale());
m_xdgOutputV1->done();
}
inline
......@@ -236,8 +236,8 @@ QString AbstractWaylandOutput::description() const
void AbstractWaylandOutput::setWaylandMode(const QSize &size, int refreshRate)
{
m_waylandOutput->setCurrentMode(size, refreshRate);
m_xdgOutput->setLogicalSize(pixelSize() / scale());
m_xdgOutput->done();
m_xdgOutputV1->setLogicalSize(pixelSize() / scale());
m_xdgOutputV1->done();
}
void AbstractWaylandOutput::initInterfaces(const QString &model, const QString &manufacturer,
......@@ -279,10 +279,10 @@ void AbstractWaylandOutput::initInterfaces(const QString &model, const QString &
// start off enabled
m_waylandOutput->create();
m_xdgOutput->setName(name());
m_xdgOutput->setDescription(description());
m_xdgOutput->setLogicalSize(pixelSize() / scale());
m_xdgOutput->done();
m_xdgOutputV1->setName(name());
m_xdgOutputV1->setDescription(description());
m_xdgOutputV1->setLogicalSize(pixelSize() / scale());
m_xdgOutputV1->done();
}
QSize AbstractWaylandOutput::orientateSize(const QSize &size) const
......
......@@ -29,7 +29,7 @@ class OutputInterface;
class OutputDeviceInterface;
class OutputChangeSet;
class OutputManagementInterface;
class XdgOutputInterface;
class XdgOutputV1Interface;
}
namespace KWin
......@@ -171,7 +171,7 @@ private:
void setTransform(KWaylandServer::OutputDeviceInterface::Transform transform);
KWaylandServer::OutputInterface *m_waylandOutput;
KWaylandServer::XdgOutputInterface *m_xdgOutput;
KWaylandServer::XdgOutputV1Interface *m_xdgOutputV1;
KWaylandServer::OutputDeviceInterface *m_waylandOutputDevice;
KWaylandServer::OutputInterface::DpmsMode m_dpms = KWaylandServer::OutputInterface::DpmsMode::On;
......
......@@ -54,7 +54,7 @@
#include <KWaylandServer/xdgdecoration_v1_interface.h>
#include <KWaylandServer/xdgshell_interface.h>
#include <KWaylandServer/xdgforeign_v2_interface.h>
#include <KWaylandServer/xdgoutput_interface.h>
#include <KWaylandServer/xdgoutput_v1_interface.h>
#include <KWaylandServer/keystate_interface.h>
#include <KWaylandServer/filtered_display.h>
#include <KWaylandServer/keyboard_shortcuts_inhibit_v1_interface.h>
......@@ -481,8 +481,7 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags
});
m_outputManagement->create();
m_xdgOutputManager = m_display->createXdgOutputManager(m_display);
m_xdgOutputManager->create();
m_xdgOutputManagerV1 = m_display->createXdgOutputManagerV1(m_display);
m_display->createSubCompositor(m_display)->create();
......
......@@ -53,7 +53,7 @@ class PlasmaWindowManagementInterface;
class OutputManagementInterface;
class OutputConfigurationInterface;
class XdgForeignV2Interface;
class XdgOutputManagerInterface;
class XdgOutputManagerV1Interface;
class KeyStateInterface;
class LinuxDmabufUnstableV1Interface;
class LinuxDmabufUnstableV1Buffer;
......@@ -123,8 +123,8 @@ public:
KWaylandServer::ServerSideDecorationManagerInterface *decorationManager() const {
return m_decorationManager;
}
KWaylandServer::XdgOutputManagerInterface *xdgOutputManager() const {
return m_xdgOutputManager;
KWaylandServer::XdgOutputManagerV1Interface *xdgOutputManagerV1() const {
return m_xdgOutputManagerV1;
}
KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *keyboardShortcutsInhibitManager() const
{
......@@ -276,7 +276,7 @@ private:
KWaylandServer::AppMenuManagerInterface *m_appMenuManager = nullptr;
KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr;
KWaylandServer::IdleInterface *m_idle = nullptr;
KWaylandServer::XdgOutputManagerInterface *m_xdgOutputManager = nullptr;
KWaylandServer::XdgOutputManagerV1Interface *m_xdgOutputManagerV1 = nullptr;
KWaylandServer::XdgDecorationManagerV1Interface *m_xdgDecorationManagerV1 = nullptr;
KWaylandServer::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr;
KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *m_keyboardShortcutsInhibitManager = nullptr;
......
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