From 319869881c87df50a94d774dcc5119b685c15264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 25 Apr 2016 09:45:04 +0200 Subject: [PATCH] Connect Application::screensCreated to WaylandServer::initOutputs Summary: Instead of having the Application invoke initOutputs after creating the Screens, we can just connect to the signal emitted there. This allows to make initOutputs a private, WaylandServer internal method. Reviewers: #plasma Subscribers: plasma-devel Projects: #plasma Differential Revision: https://phabricator.kde.org/D1482 --- autotests/wayland/kwin_wayland_test.cpp | 1 - main_wayland.cpp | 1 - wayland_server.cpp | 2 ++ wayland_server.h | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index d37015b27e..9766b8d40f 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -110,7 +110,6 @@ void WaylandTestApplication::continueStartupWithScreens() { disconnect(kwinApp()->platform(), &Platform::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens); createScreens(); - waylandServer()->initOutputs(); createCompositor(); connect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::startXwaylandServer); diff --git a/main_wayland.cpp b/main_wayland.cpp index 0f6d5d60b0..ceac601df7 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -145,7 +145,6 @@ void ApplicationWayland::continueStartupWithScreens() { disconnect(kwinApp()->platform(), &Platform::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); createScreens(); - waylandServer()->initOutputs(); if (!m_startXWayland) { continueStartupWithX(); diff --git a/wayland_server.cpp b/wayland_server.cpp index ff2e64e2a1..174452fed2 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -73,6 +73,8 @@ WaylandServer::WaylandServer(QObject *parent) { qRegisterMetaType("KWayland::Server::SurfaceInterface *"); qRegisterMetaType(); + + connect(kwinApp(), &Application::screensCreated, this, &WaylandServer::initOutputs); } WaylandServer::~WaylandServer() diff --git a/wayland_server.h b/wayland_server.h index a44af9a290..a24f665440 100644 --- a/wayland_server.h +++ b/wayland_server.h @@ -74,7 +74,6 @@ public: virtual ~WaylandServer(); void init(const QByteArray &socketName = QByteArray(), InitalizationFlags flags = InitalizationFlag::NoOptions); - void initOutputs(); void terminateClientConnections(); KWayland::Server::Display *display() { @@ -160,6 +159,7 @@ Q_SIGNALS: void terminatingInternalClientConnection(); private: + void initOutputs(); quint16 createClientId(KWayland::Server::ClientConnection *c); void destroyInternalConnection(); void configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *config);