diff --git a/src/lib/fcitx/instance.cpp b/src/lib/fcitx/instance.cpp index 4aaae06d70ad2674e6cf0e1c4119ea259d3af0de..61dd23a43af7c15c6ab7cee8b1cfc9b897933b0c 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);