Skip to content

Commit 9942cde

Browse files
committed
show the specific input method name on the tray icon
1 parent 9989e72 commit 9942cde

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/modules/notificationitem/notificationitem.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,14 @@ class StatusNotifierItem : public dbus::ObjectVTable<StatusNotifierItem> {
138138
FCITX_OBJECT_VTABLE_PROPERTY(category, "Category", "s",
139139
[]() { return "SystemServices"; });
140140
FCITX_OBJECT_VTABLE_PROPERTY(id, "Id", "s", []() { return "Fcitx"; });
141-
FCITX_OBJECT_VTABLE_PROPERTY(title, "Title", "s",
142-
[]() { return _("Input Method"); });
141+
FCITX_OBJECT_VTABLE_PROPERTY(title, "Title", "s", [this]() {
142+
const InputMethodEntry *imEntry;
143+
if (auto *ic = parent_->menu()->lastRelevantIc()) {
144+
imEntry = parent_->instance()->inputMethodEntry(ic);
145+
}
146+
147+
return imEntry == nullptr ? _("Input Method") : imEntry->name();
148+
});
143149
FCITX_OBJECT_VTABLE_PROPERTY(status, "Status", "s",
144150
[]() { return "Active"; });
145151
FCITX_OBJECT_VTABLE_PROPERTY(windowId, "WindowId", "i", []() { return 0; });

0 commit comments

Comments
 (0)