From dfabb59c26ea5cc6ff9ef725f64db660fd0870e1 Mon Sep 17 00:00:00 2001 From: Stay <2607159984@qq.com> Date: Tue, 14 May 2024 12:17:09 +0000 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=BB=98=E8=AE=A4=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=B3=95=E5=88=97=E8=A1=A8=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/fcitx/instance.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/fcitx/instance.cpp b/src/lib/fcitx/instance.cpp index 4aaae06d..61dd23a4 100644 --- a/src/lib/fcitx/instance.cpp +++ b/src/lib/fcitx/instance.cpp @@ -339,11 +339,15 @@ void InstancePrivate::buildDefaultGroup() { // Figure out the first available default input method. std::string defaultIM; + std::vector imList; + bool isFirstInputMethod = true; for (const auto &im : defaultIMConfig.defaultInputMethods.value()) { - if (imManager_.entry(im)) { + if (isFirstInputMethod && imManager_.entry(im)) { defaultIM = im; - break; + isFirstInputMethod = !isFirstInputMethod; + continue; } + imList.push_back(im); } // Create a group for each layout. @@ -364,6 +368,14 @@ void InstancePrivate::buildDefaultGroup() { group.inputMethodList().emplace_back( InputMethodGroupItem(defaultIM)); } + + //Import the input method list of the configuration file into the group in sequence + for(const auto &im : imList) + { + group.inputMethodList().emplace_back( + InputMethodGroupItem(im)); + } + FCITX_INFO() << "Items in " << groupName << ": " << group.inputMethodList(); group.setDefaultLayout(imLayout); -- Gitee