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.
This commit is contained in:
Martin Gräßlin 2015-04-24 09:23:18 +02:00
parent 7aee69a6b2
commit 3a05e4b535
3 changed files with 8 additions and 2 deletions

View file

@ -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
}

View file

@ -152,6 +152,11 @@ void ApplicationWayland::continueStartupWithScreens()
if (Wayland::WaylandBackend *w = dynamic_cast<Wayland::WaylandBackend *>(waylandServer()->backend())) {
disconnect(w, &Wayland::WaylandBackend::outputsChanged, this, &ApplicationWayland::continueStartupWithScreens);
}
#if HAVE_DRM
if (DrmBackend *b = dynamic_cast<DrmBackend*>(waylandServer()->backend())) {
disconnect(b, &DrmBackend::screensQueried, this, &ApplicationWayland::continueStartupWithScreens);
}
#endif
createScreens();
waylandServer()->initOutputs();

View file

@ -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;