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;