From 468a59cbb3a507e7efc29ece9fa0386d6271efb7 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 16 Nov 2021 17:13:58 +0100 Subject: [PATCH] shell: Make sure the primary output is initialised on X11 as well BUG: 445589 --- shell/primaryoutputwatcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell/primaryoutputwatcher.cpp b/shell/primaryoutputwatcher.cpp index 3539b5d90..f44819432 100644 --- a/shell/primaryoutputwatcher.cpp +++ b/shell/primaryoutputwatcher.cpp @@ -52,6 +52,10 @@ PrimaryOutputWatcher::PrimaryOutputWatcher(QObject *parent) qGuiApp->installNativeEventFilter(this); const xcb_query_extension_reply_t *reply = xcb_get_extension_data(QX11Info::connection(), &xcb_randr_id); m_xrandrExtensionOffset = reply->first_event; + setPrimaryOutputName(qGuiApp->primaryScreen()->name()); + connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, [this](QScreen *newPrimary) { + setPrimaryOutputName(newPrimary->name()); + }); } #endif if (KWindowSystem::isPlatformWayland()) {