diff --git a/platform.h b/platform.h --- a/platform.h +++ b/platform.h @@ -321,10 +321,6 @@ bool isCursorHidden() const { return m_hideCursorCounter > 0; } - - bool handlesOutputs() const { - return m_handlesOutputs; - } bool isReady() const { return m_ready; } @@ -490,9 +486,6 @@ 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 @@ struct { QRect lastRenderedGeometry; } m_cursor; - bool m_handlesOutputs = false; bool m_ready = false; QSize m_initialWindowSize; QByteArray m_deviceIdentifier; diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -83,7 +83,6 @@ } #endif setSupportsGammaControl(true); - handleOutputs(); } DrmBackend::~DrmBackend() diff --git a/plugins/platforms/fbdev/fb_backend.cpp b/plugins/platforms/fbdev/fb_backend.cpp --- a/plugins/platforms/fbdev/fb_backend.cpp +++ b/plugins/platforms/fbdev/fb_backend.cpp @@ -51,7 +51,6 @@ FramebufferBackend::FramebufferBackend(QObject *parent) : Platform(parent) { - handleOutputs(); } FramebufferBackend::~FramebufferBackend() diff --git a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp --- a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp +++ b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp @@ -152,7 +152,6 @@ SLOT(screenBrightnessChanged(int)))) { qCWarning(KWIN_HWCOMPOSER) << "Failed to connect to brightness control"; } - handleOutputs(); } HwcomposerBackend::~HwcomposerBackend() diff --git a/plugins/platforms/virtual/virtual_backend.cpp b/plugins/platforms/virtual/virtual_backend.cpp --- a/plugins/platforms/virtual/virtual_backend.cpp +++ b/plugins/platforms/virtual/virtual_backend.cpp @@ -49,7 +49,6 @@ } setSupportsPointerWarping(true); setSupportsGammaControl(true); - handleOutputs(); } VirtualBackend::~VirtualBackend() diff --git a/plugins/platforms/wayland/wayland_backend.cpp b/plugins/platforms/wayland/wayland_backend.cpp --- a/plugins/platforms/wayland/wayland_backend.cpp +++ b/plugins/platforms/wayland/wayland_backend.cpp @@ -454,7 +454,6 @@ , m_connectionThread(nullptr) { connect(this, &WaylandBackend::connectionFailed, this, &WaylandBackend::initFailed); - handleOutputs(); } WaylandBackend::~WaylandBackend() diff --git a/plugins/platforms/x11/windowed/x11windowed_backend.cpp b/plugins/platforms/x11/windowed/x11windowed_backend.cpp --- a/plugins/platforms/x11/windowed/x11windowed_backend.cpp +++ b/plugins/platforms/x11/windowed/x11windowed_backend.cpp @@ -54,7 +54,6 @@ { setSupportsPointerWarping(true); connect(this, &X11WindowedBackend::sizeChanged, this, &X11WindowedBackend::screenSizeChanged); - handleOutputs(); } X11WindowedBackend::~X11WindowedBackend() diff --git a/wayland_server.h b/wayland_server.h --- a/wayland_server.h +++ b/wayland_server.h @@ -233,8 +233,6 @@ private: void shellClientShown(Toplevel *t); - void initOutputs(); - void syncOutputsToWayland(); quint16 createClientId(KWayland::Server::ClientConnection *c); void destroyInternalConnection(); void configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *config); diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -97,8 +97,6 @@ : QObject(parent) { qRegisterMetaType(); - - connect(kwinApp(), &Application::screensCreated, this, &WaylandServer::initOutputs); } WaylandServer::~WaylandServer() @@ -541,47 +539,6 @@ 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;