diff --git a/backends/wayland/wayland_backend.cpp b/backends/wayland/wayland_backend.cpp index f578b3380a..9b1f784818 100644 --- a/backends/wayland/wayland_backend.cpp +++ b/backends/wayland/wayland_backend.cpp @@ -33,7 +33,6 @@ along with this program. If not, see . #include #include #include -#include #include #include #include @@ -279,13 +278,11 @@ WaylandBackend::WaylandBackend(QObject *parent) , m_connectionThreadObject(new ConnectionThread(nullptr)) , m_connectionThread(nullptr) { - connect(this, &WaylandBackend::outputsChanged, this, &WaylandBackend::screensQueried); connect(this, &WaylandBackend::connectionFailed, this, &WaylandBackend::initFailed); } WaylandBackend::~WaylandBackend() { - destroyOutputs(); if (m_shellSurface) { m_shellSurface->release(); } @@ -318,14 +315,6 @@ void WaylandBackend::init() m_shell->setup(m_registry->bindShell(name, 1)); } ); - connect(m_registry, &Registry::outputAnnounced, this, - [this](quint32 name) { - Output *output = new Output(this); - output->setup(m_registry->bindOutput(name, 2)); - m_outputs.append(output); - connect(output, &Output::changed, this, &WaylandBackend::outputsChanged); - } - ); connect(m_registry, &Registry::seatAnnounced, this, [this](quint32 name) { if (Application::usesLibinput()) { @@ -344,12 +333,6 @@ void WaylandBackend::init() initConnection(); } -void WaylandBackend::destroyOutputs() -{ - qDeleteAll(m_outputs); - m_outputs.clear(); -} - void WaylandBackend::initConnection() { connect(m_connectionThreadObject, &ConnectionThread::connected, this, @@ -369,7 +352,6 @@ void WaylandBackend::initConnection() emit systemCompositorDied(); m_seat.reset(); m_shm->destroy(); - destroyOutputs(); if (m_shellSurface) { m_shellSurface->destroy(); delete m_shellSurface; @@ -445,6 +427,7 @@ void WaylandBackend::createSurface() m_shellSurface->setSize(initialWindowSize()); m_shellSurface->setToplevel(); setReady(true); + emit screensQueried(); } } diff --git a/backends/wayland/wayland_backend.h b/backends/wayland/wayland_backend.h index d6f9b0c2f3..453f6c98ae 100644 --- a/backends/wayland/wayland_backend.h +++ b/backends/wayland/wayland_backend.h @@ -46,7 +46,6 @@ class Compositor; class ConnectionThread; class EventQueue; class Keyboard; -class Output; class Pointer; class Registry; class Seat; @@ -113,7 +112,6 @@ public: void init() override; wl_display *display(); KWayland::Client::Compositor *compositor(); - const QList &outputs() const; KWayland::Client::ShmPool *shmPool(); KWayland::Client::Surface *surface() const; @@ -128,12 +126,10 @@ public: Q_SIGNALS: void shellSurfaceSizeChanged(const QSize &size); void systemCompositorDied(); - void outputsChanged(); void connectionFailed(); private: void initConnection(); void createSurface(); - void destroyOutputs(); wl_display *m_display; KWayland::Client::EventQueue *m_eventQueue; KWayland::Client::Registry *m_registry; @@ -143,7 +139,6 @@ private: KWayland::Client::ShellSurface *m_shellSurface; QScopedPointer m_seat; KWayland::Client::ShmPool *m_shm; - QList m_outputs; KWayland::Client::ConnectionThread *m_connectionThreadObject; QThread *m_connectionThread; }; @@ -172,12 +167,6 @@ KWayland::Client::Surface *WaylandBackend::surface() const return m_surface; } -inline -const QList< KWayland::Client::Output* >& WaylandBackend::outputs() const -{ - return m_outputs; -} - } // namespace Wayland } // namespace KWin