platforms/x11: Init outputs during platform initialization

This commit is contained in:
Vlad Zahorodnii 2020-12-20 14:22:48 +02:00
parent 8a606e47c4
commit 2567d0c935
2 changed files with 5 additions and 5 deletions

View file

@ -32,10 +32,6 @@ XRandRScreens::~XRandRScreens() = default;
void XRandRScreens::init()
{
KWin::Screens::init();
// we need to call ScreenResources at least once to be able to use current
m_backend->initOutputs();
setCount(m_backend->outputs().count());
emit changed();
#ifndef KWIN_UNIT_TEST
connect(this, &XRandRScreens::changed, this, [] {

View file

@ -94,7 +94,7 @@ void X11StandalonePlatform::init()
}
XRenderUtils::init(kwinApp()->x11Connection(), kwinApp()->x11RootWindow());
setReady(true);
emit screensQueried();
initOutputs();
}
Screens *X11StandalonePlatform::createScreens(QObject *parent)
@ -455,11 +455,13 @@ void X11StandalonePlatform::doUpdateOutputs()
if (!Xcb::Extensions::self()->isRandrAvailable()) {
fallback();
emit screensQueried();
return;
}
T resources(rootWindow());
if (resources.isNull()) {
fallback();
emit screensQueried();
return;
}
xcb_randr_crtc_t *crtcs = resources.crtcs();
@ -545,6 +547,8 @@ void X11StandalonePlatform::doUpdateOutputs()
if (m_outputs.isEmpty()) {
fallback();
}
emit screensQueried();
}
Outputs X11StandalonePlatform::outputs() const