From 2567d0c935de41b61dc5ccdb60247e694aa0cdc4 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 20 Dec 2020 14:22:48 +0200 Subject: [PATCH] platforms/x11: Init outputs during platform initialization --- plugins/platforms/x11/standalone/screens_xrandr.cpp | 4 ---- plugins/platforms/x11/standalone/x11_platform.cpp | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/platforms/x11/standalone/screens_xrandr.cpp b/plugins/platforms/x11/standalone/screens_xrandr.cpp index 4bf1e395f4..9ca64c732d 100644 --- a/plugins/platforms/x11/standalone/screens_xrandr.cpp +++ b/plugins/platforms/x11/standalone/screens_xrandr.cpp @@ -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, [] { diff --git a/plugins/platforms/x11/standalone/x11_platform.cpp b/plugins/platforms/x11/standalone/x11_platform.cpp index e9a5edcef7..15f78142f1 100644 --- a/plugins/platforms/x11/standalone/x11_platform.cpp +++ b/plugins/platforms/x11/standalone/x11_platform.cpp @@ -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