From 3a05e4b5353ce128c97a95e665caadb5588bfd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 24 Apr 2015 09:23:18 +0200 Subject: [PATCH] Update ScreensDrm whenever the screens got queried in the DrmBackend Requires to move the screensQueried signal and disconnect during Application startup. As Screens only hold the geometry of each screen and the overall geometry, there is no need (yet) to update in more detail when a DrmOutput is added or removed. The overall queried is sufficient. --- drm_backend.cpp | 3 +-- main_wayland.cpp | 5 +++++ screens_drm.cpp | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drm_backend.cpp b/drm_backend.cpp index 64f312d4c1..c874f82c0d 100644 --- a/drm_backend.cpp +++ b/drm_backend.cpp @@ -226,8 +226,6 @@ void DrmBackend::openDrm() } } - emit screensQueried(); - initCursor(); } @@ -307,6 +305,7 @@ void DrmBackend::queryResources() } } m_outputs = connectedOutputs; + emit screensQueried(); // TODO: install global space } diff --git a/main_wayland.cpp b/main_wayland.cpp index 47f0e29788..11c886dfbf 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -152,6 +152,11 @@ void ApplicationWayland::continueStartupWithScreens() if (Wayland::WaylandBackend *w = dynamic_cast(waylandServer()->backend())) { disconnect(w, &Wayland::WaylandBackend::outputsChanged, this, &ApplicationWayland::continueStartupWithScreens); } +#if HAVE_DRM + if (DrmBackend *b = dynamic_cast(waylandServer()->backend())) { + disconnect(b, &DrmBackend::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); + } +#endif createScreens(); waylandServer()->initOutputs(); diff --git a/screens_drm.cpp b/screens_drm.cpp index c3f5cdd40a..fe413450f6 100644 --- a/screens_drm.cpp +++ b/screens_drm.cpp @@ -27,6 +27,8 @@ DrmScreens::DrmScreens(DrmBackend *backend, QObject *parent) : Screens(parent) , m_backend(backend) { + connect(backend, &DrmBackend::screensQueried, this, &DrmScreens::updateCount); + connect(backend, &DrmBackend::screensQueried, this, &DrmScreens::changed); } DrmScreens::~DrmScreens() = default;