Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions src/modules/wayland/waylandmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,20 +716,30 @@ void WaylandModule::selfDiagnose() {
}
}

std::unordered_set<std::string> groupLayouts;
for (const auto &groupName : instance_->inputMethodManager().groups()) {
if (const auto *group =
instance_->inputMethodManager().group(groupName)) {
groupLayouts.insert(group->defaultLayout());
}
if (groupLayouts.size() >= 2) {
messages.push_back(
_("Sending keyboard layout configuration to wayland "
"compositor from Fcitx is "
"not yet supported on current desktop. You may still use "
"Fcitx's internal layout conversion by adding layout as "
"input method to the input method group."));
break;
// layout diagnosis only when overriding is enabled
if (*config_.allowOverrideXKB) {
std::optional<std::string> firstLayout;
for (const auto &groupName :
instance_->inputMethodManager().groups()) {
if (const auto *group =
instance_->inputMethodManager().group(groupName)) {
const auto &layout = group->defaultLayout();
if (!firstLayout) {
firstLayout = layout;
} else if (layout != *firstLayout) {
messages.push_back(_(
"Sending keyboard layout configuration to wayland "
"compositor from Fcitx is "
"not yet supported on current desktop. You may "
"still "
"use "
"Fcitx's internal layout conversion by adding "
"layout "
"as "
"input method to the input method group."));
break;
}
}
}
}

Expand Down
Loading