Commit 2567d0c9 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

platforms/x11: Init outputs during platform initialization

parent 8a606e47
......@@ -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, [] {
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment