Remove outputs handling alternative

Summary:
With f013a4369c, cd6b69a4d2, d960be4b3f and edb200f6bc all possible
backends of a Wayland session have been ported to using the internal functions
of AbstractWaylandOutput's for managing outputs.

This removes the alternative code path used before in these backends, what
simplifies the code and is also a prerequisite to removing the Screens global
in the future.

Reviewers: #kwin, apol, zzag

Reviewed By: #kwin, apol, zzag

Subscribers: apol, kwin

Tags: #kwin

Maniphest Tasks: T11459, T11098

Differential Revision: https://phabricator.kde.org/D23485
This commit is contained in:
Roman Gilg 2019-08-27 12:42:58 +02:00
parent 331f5d7da7
commit 5cc626c102
9 changed files with 0 additions and 59 deletions

View file

@ -321,10 +321,6 @@ public:
bool isCursorHidden() const {
return m_hideCursorCounter > 0;
}
bool handlesOutputs() const {
return m_handlesOutputs;
}
bool isReady() const {
return m_ready;
}
@ -490,9 +486,6 @@ Q_SIGNALS:
protected:
explicit Platform(QObject *parent = nullptr);
void setSoftWareCursor(bool set);
void handleOutputs() {
m_handlesOutputs = true;
}
void repaint(const QRect &rect);
void setReady(bool ready);
QSize initialWindowSize() const {
@ -538,7 +531,6 @@ private:
struct {
QRect lastRenderedGeometry;
} m_cursor;
bool m_handlesOutputs = false;
bool m_ready = false;
QSize m_initialWindowSize;
QByteArray m_deviceIdentifier;

View file

@ -83,7 +83,6 @@ DrmBackend::DrmBackend(QObject *parent)
}
#endif
setSupportsGammaControl(true);
handleOutputs();
}
DrmBackend::~DrmBackend()

View file

@ -51,7 +51,6 @@ void FramebufferOutput::init(const QSize &pixelSize, const QSize &physicalSize)
FramebufferBackend::FramebufferBackend(QObject *parent)
: Platform(parent)
{
handleOutputs();
}
FramebufferBackend::~FramebufferBackend()

View file

@ -152,7 +152,6 @@ HwcomposerBackend::HwcomposerBackend(QObject *parent)
SLOT(screenBrightnessChanged(int)))) {
qCWarning(KWIN_HWCOMPOSER) << "Failed to connect to brightness control";
}
handleOutputs();
}
HwcomposerBackend::~HwcomposerBackend()

View file

@ -49,7 +49,6 @@ VirtualBackend::VirtualBackend(QObject *parent)
}
setSupportsPointerWarping(true);
setSupportsGammaControl(true);
handleOutputs();
}
VirtualBackend::~VirtualBackend()

View file

@ -454,7 +454,6 @@ WaylandBackend::WaylandBackend(QObject *parent)
, m_connectionThread(nullptr)
{
connect(this, &WaylandBackend::connectionFailed, this, &WaylandBackend::initFailed);
handleOutputs();
}
WaylandBackend::~WaylandBackend()

View file

@ -54,7 +54,6 @@ X11WindowedBackend::X11WindowedBackend(QObject *parent)
{
setSupportsPointerWarping(true);
connect(this, &X11WindowedBackend::sizeChanged, this, &X11WindowedBackend::screenSizeChanged);
handleOutputs();
}
X11WindowedBackend::~X11WindowedBackend()

View file

@ -97,8 +97,6 @@ WaylandServer::WaylandServer(QObject *parent)
: QObject(parent)
{
qRegisterMetaType<KWayland::Server::OutputInterface::DpmsMode>();
connect(kwinApp(), &Application::screensCreated, this, &WaylandServer::initOutputs);
}
WaylandServer::~WaylandServer()
@ -541,47 +539,6 @@ void WaylandServer::initScreenLocker()
emit initialized();
}
void WaylandServer::initOutputs()
{
if (kwinApp()->platform()->handlesOutputs()) {
return;
}
syncOutputsToWayland();
connect(screens(), &Screens::changed, this,
[this] {
// when screens change we need to sync this to Wayland.
// Unfortunately we don't have much information and cannot properly match a KWin screen
// to a Wayland screen.
// Thus we just recreate all outputs and delete the old ones
const auto outputs = m_display->outputs();
syncOutputsToWayland();
qDeleteAll(outputs);
}
);
}
void WaylandServer::syncOutputsToWayland()
{
Screens *s = screens();
Q_ASSERT(s);
for (int i = 0; i < s->count(); ++i) {
OutputInterface *output = m_display->createOutput(m_display);
auto xdgOutput = xdgOutputManager()->createXdgOutput(output, output);
output->setScale(s->scale(i));
const QRect &geo = s->geometry(i);
output->setGlobalPosition(geo.topLeft());
output->setPhysicalSize(s->physicalSize(i).toSize());
output->addMode(geo.size());
xdgOutput->setLogicalPosition(geo.topLeft());
xdgOutput->setLogicalSize(geo.size());
xdgOutput->done();
output->create();
}
}
WaylandServer::SocketPairConnection WaylandServer::createConnection()
{
SocketPairConnection ret;

View file

@ -233,8 +233,6 @@ Q_SIGNALS:
private:
void shellClientShown(Toplevel *t);
void initOutputs();
void syncOutputsToWayland();
quint16 createClientId(KWayland::Server::ClientConnection *c);
void destroyInternalConnection();
void configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *config);