Adapt to XdgOutputManagerV1 changes

master
Vlad Zahorodnii 2020-08-20 17:53:10 +03:00
parent 05e62f5559
commit 925bb4eea3
4 changed files with 22 additions and 23 deletions

View File

@ -15,7 +15,7 @@
// KWayland // KWayland
#include <KWaylandServer/display.h> #include <KWaylandServer/display.h>
#include <KWaylandServer/outputchangeset.h> #include <KWaylandServer/outputchangeset.h>
#include <KWaylandServer/xdgoutput_interface.h> #include <KWaylandServer/xdgoutput_v1_interface.h>
// KF5 // KF5
#include <KLocalizedString> #include <KLocalizedString>
@ -30,7 +30,7 @@ AbstractWaylandOutput::AbstractWaylandOutput(QObject *parent)
{ {
m_waylandOutput = waylandServer()->display()->createOutput(this); m_waylandOutput = waylandServer()->display()->createOutput(this);
m_waylandOutputDevice = waylandServer()->display()->createOutputDevice(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, connect(m_waylandOutput, &KWaylandServer::OutputInterface::dpmsModeRequested, this,
[this] (KWaylandServer::OutputInterface::DpmsMode mode) { [this] (KWaylandServer::OutputInterface::DpmsMode mode) {
@ -81,8 +81,8 @@ void AbstractWaylandOutput::setGlobalPos(const QPoint &pos)
m_waylandOutputDevice->setGlobalPosition(pos); m_waylandOutputDevice->setGlobalPosition(pos);
m_waylandOutput->setGlobalPosition(pos); m_waylandOutput->setGlobalPosition(pos);
m_xdgOutput->setLogicalPosition(pos); m_xdgOutputV1->setLogicalPosition(pos);
m_xdgOutput->done(); m_xdgOutputV1->done();
} }
QSize AbstractWaylandOutput::modeSize() const 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 // or maybe even set this to 3 when we're scaling to 1.5
// don't treat this like it's chosen deliberately // don't treat this like it's chosen deliberately
m_waylandOutput->setScale(std::ceil(scale)); m_waylandOutput->setScale(std::ceil(scale));
m_xdgOutput->setLogicalSize(pixelSize() / scale); m_xdgOutputV1->setLogicalSize(pixelSize() / scale);
m_xdgOutput->done(); m_xdgOutputV1->done();
} }
using DeviceInterface = KWaylandServer::OutputDeviceInterface; using DeviceInterface = KWaylandServer::OutputDeviceInterface;
@ -147,8 +147,8 @@ void AbstractWaylandOutput::setTransform(DeviceInterface::Transform transform)
m_waylandOutputDevice->setTransform(transform); m_waylandOutputDevice->setTransform(transform);
m_waylandOutput->setTransform(toOutputTransform(transform)); m_waylandOutput->setTransform(toOutputTransform(transform));
m_xdgOutput->setLogicalSize(pixelSize() / scale()); m_xdgOutputV1->setLogicalSize(pixelSize() / scale());
m_xdgOutput->done(); m_xdgOutputV1->done();
} }
inline inline
@ -236,8 +236,8 @@ QString AbstractWaylandOutput::description() const
void AbstractWaylandOutput::setWaylandMode(const QSize &size, int refreshRate) void AbstractWaylandOutput::setWaylandMode(const QSize &size, int refreshRate)
{ {
m_waylandOutput->setCurrentMode(size, refreshRate); m_waylandOutput->setCurrentMode(size, refreshRate);
m_xdgOutput->setLogicalSize(pixelSize() / scale()); m_xdgOutputV1->setLogicalSize(pixelSize() / scale());
m_xdgOutput->done(); m_xdgOutputV1->done();
} }
void AbstractWaylandOutput::initInterfaces(const QString &model, const QString &manufacturer, void AbstractWaylandOutput::initInterfaces(const QString &model, const QString &manufacturer,
@ -279,10 +279,10 @@ void AbstractWaylandOutput::initInterfaces(const QString &model, const QString &
// start off enabled // start off enabled
m_waylandOutput->create(); m_waylandOutput->create();
m_xdgOutput->setName(name()); m_xdgOutputV1->setName(name());
m_xdgOutput->setDescription(description()); m_xdgOutputV1->setDescription(description());
m_xdgOutput->setLogicalSize(pixelSize() / scale()); m_xdgOutputV1->setLogicalSize(pixelSize() / scale());
m_xdgOutput->done(); m_xdgOutputV1->done();
} }
QSize AbstractWaylandOutput::orientateSize(const QSize &size) const QSize AbstractWaylandOutput::orientateSize(const QSize &size) const

View File

@ -29,7 +29,7 @@ class OutputInterface;
class OutputDeviceInterface; class OutputDeviceInterface;
class OutputChangeSet; class OutputChangeSet;
class OutputManagementInterface; class OutputManagementInterface;
class XdgOutputInterface; class XdgOutputV1Interface;
} }
namespace KWin namespace KWin
@ -171,7 +171,7 @@ private:
void setTransform(KWaylandServer::OutputDeviceInterface::Transform transform); void setTransform(KWaylandServer::OutputDeviceInterface::Transform transform);
KWaylandServer::OutputInterface *m_waylandOutput; KWaylandServer::OutputInterface *m_waylandOutput;
KWaylandServer::XdgOutputInterface *m_xdgOutput; KWaylandServer::XdgOutputV1Interface *m_xdgOutputV1;
KWaylandServer::OutputDeviceInterface *m_waylandOutputDevice; KWaylandServer::OutputDeviceInterface *m_waylandOutputDevice;
KWaylandServer::OutputInterface::DpmsMode m_dpms = KWaylandServer::OutputInterface::DpmsMode::On; KWaylandServer::OutputInterface::DpmsMode m_dpms = KWaylandServer::OutputInterface::DpmsMode::On;

View File

@ -54,7 +54,7 @@
#include <KWaylandServer/xdgdecoration_v1_interface.h> #include <KWaylandServer/xdgdecoration_v1_interface.h>
#include <KWaylandServer/xdgshell_interface.h> #include <KWaylandServer/xdgshell_interface.h>
#include <KWaylandServer/xdgforeign_v2_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/keystate_interface.h>
#include <KWaylandServer/filtered_display.h> #include <KWaylandServer/filtered_display.h>
#include <KWaylandServer/keyboard_shortcuts_inhibit_v1_interface.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_outputManagement->create();
m_xdgOutputManager = m_display->createXdgOutputManager(m_display); m_xdgOutputManagerV1 = m_display->createXdgOutputManagerV1(m_display);
m_xdgOutputManager->create();
m_display->createSubCompositor(m_display)->create(); m_display->createSubCompositor(m_display)->create();

View File

@ -53,7 +53,7 @@ class PlasmaWindowManagementInterface;
class OutputManagementInterface; class OutputManagementInterface;
class OutputConfigurationInterface; class OutputConfigurationInterface;
class XdgForeignV2Interface; class XdgForeignV2Interface;
class XdgOutputManagerInterface; class XdgOutputManagerV1Interface;
class KeyStateInterface; class KeyStateInterface;
class LinuxDmabufUnstableV1Interface; class LinuxDmabufUnstableV1Interface;
class LinuxDmabufUnstableV1Buffer; class LinuxDmabufUnstableV1Buffer;
@ -123,8 +123,8 @@ public:
KWaylandServer::ServerSideDecorationManagerInterface *decorationManager() const { KWaylandServer::ServerSideDecorationManagerInterface *decorationManager() const {
return m_decorationManager; return m_decorationManager;
} }
KWaylandServer::XdgOutputManagerInterface *xdgOutputManager() const { KWaylandServer::XdgOutputManagerV1Interface *xdgOutputManagerV1() const {
return m_xdgOutputManager; return m_xdgOutputManagerV1;
} }
KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *keyboardShortcutsInhibitManager() const KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *keyboardShortcutsInhibitManager() const
{ {
@ -276,7 +276,7 @@ private:
KWaylandServer::AppMenuManagerInterface *m_appMenuManager = nullptr; KWaylandServer::AppMenuManagerInterface *m_appMenuManager = nullptr;
KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr; KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr;
KWaylandServer::IdleInterface *m_idle = nullptr; KWaylandServer::IdleInterface *m_idle = nullptr;
KWaylandServer::XdgOutputManagerInterface *m_xdgOutputManager = nullptr; KWaylandServer::XdgOutputManagerV1Interface *m_xdgOutputManagerV1 = nullptr;
KWaylandServer::XdgDecorationManagerV1Interface *m_xdgDecorationManagerV1 = nullptr; KWaylandServer::XdgDecorationManagerV1Interface *m_xdgDecorationManagerV1 = nullptr;
KWaylandServer::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr; KWaylandServer::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr;
KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *m_keyboardShortcutsInhibitManager = nullptr; KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *m_keyboardShortcutsInhibitManager = nullptr;