From 630a85cbcb01ec41626511d5c16aaca4bab5f4a5 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Thu, 23 Nov 2023 10:28:19 -0800 Subject: [PATCH] bin: Ensure that plasma-mobile-envmanager is run prior to shell start --- bin/startplasmamobile.in | 5 ++++- envmanager/config.h | 4 ++-- envmanager/settings.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/startplasmamobile.in b/bin/startplasmamobile.in index 3c1c79a2..f2154683 100755 --- a/bin/startplasmamobile.in +++ b/bin/startplasmamobile.in @@ -23,6 +23,9 @@ then export KDE_COREDUMP_NOTIFY=1 fi -# TODO port away from PLASMA_DEFAULT_SHELL into QT_QPA_PLATFORM=offscreen plasma-apply-lookandfeel --apply org.kde.plasma.phone +# ensure that we have our environment settings set properly prior to the shell being loaded (otherwise there is a race condition with autostart) +QT_QPA_PLATFORM=offscreen plasma-mobile-envmanager --apply-settings + +# start the shell export PLASMA_DEFAULT_SHELL=org.kde.plasma.mobileshell startplasma-wayland --xwayland --inputmethod maliit-keyboard diff --git a/envmanager/config.h b/envmanager/config.h index 22589cad..7e57c434 100644 --- a/envmanager/config.h +++ b/envmanager/config.h @@ -14,7 +14,7 @@ // applications-blacklistrc // NOTE: we only write these entries if they are not already defined in the config -const QMap> APPLICATIONS_BLACKLIST_SETTINGS = { +const QMap> APPLICATIONS_BLACKLIST_DEFAULT_SETTINGS = { {"Applications", {{"blacklist", "cuttlefish,org.kde.plasma.themeexplorer,org.kde.klipper,ciborium,syncmonitorhelper,org.kde.okular,wordview,assistant,assistant-qt5,designer,designer-" @@ -23,7 +23,7 @@ const QMap> APPLICATIONS_BLACKLIST_SETTINGS = { // kdeglobals // NOTE: we only write these entries if they are not already defined in the config -const QMap> KDEGLOBALS_SETTINGS = {{"General", {{"BrowserApplication", "angelfish"}}}}; +const QMap> KDEGLOBALS_DEFAULT_SETTINGS = {{"General", {{"BrowserApplication", "angelfish"}}}}; // kwinrc QMap> getKwinrcSettings(KSharedConfig::Ptr m_mobileConfig) diff --git a/envmanager/settings.cpp b/envmanager/settings.cpp index f8ed3a2a..c761b031 100644 --- a/envmanager/settings.cpp +++ b/envmanager/settings.cpp @@ -61,11 +61,11 @@ void Settings::loadSavedConfiguration() reloadKWinConfig(); // applications-blacklistrc - loadKeys(QStringLiteral("applications-blacklistrc"), m_appBlacklistConfig, APPLICATIONS_BLACKLIST_SETTINGS); + loadKeys(QStringLiteral("applications-blacklistrc"), m_appBlacklistConfig, APPLICATIONS_BLACKLIST_DEFAULT_SETTINGS); m_appBlacklistConfig->sync(); // kdeglobals - loadKeys(QStringLiteral("kdeglobals"), m_kdeglobalsConfig, KDEGLOBALS_SETTINGS); + loadKeys(QStringLiteral("kdeglobals"), m_kdeglobalsConfig, KDEGLOBALS_DEFAULT_SETTINGS); m_kdeglobalsConfig->sync(); // save our changes @@ -92,12 +92,12 @@ void Settings::applyMobileConfiguration() // applications-blacklistrc // NOTE: we only write entries if they are not already defined in the config - writeKeys(QStringLiteral("applications-blacklistrc"), m_appBlacklistConfig, APPLICATIONS_BLACKLIST_SETTINGS, true); + writeKeys(QStringLiteral("applications-blacklistrc"), m_appBlacklistConfig, APPLICATIONS_BLACKLIST_DEFAULT_SETTINGS, true); m_appBlacklistConfig->sync(); // kdeglobals // NOTE: we only write entries if they are not already defined in the config - writeKeys(QStringLiteral("kdeglobals"), m_kdeglobalsConfig, KDEGLOBALS_SETTINGS, true); + writeKeys(QStringLiteral("kdeglobals"), m_kdeglobalsConfig, KDEGLOBALS_DEFAULT_SETTINGS, true); m_kdeglobalsConfig->sync(); // save our changes