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
15 changes: 14 additions & 1 deletion src/panel/widgets/tray/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,23 @@ std::string StatusNotifierItem::dbus_name_as_prefix()
map[CHARS_IN[i]] = CHARS_OUT[i];
}

// Well-known names (e.g. Electron's "org.freedesktop.StatusNotifierItem-2916-1") contain
// letters and '-', which map[] doesn't cover: map[c] would insert '\0' and the prefix
// would no longer match the inserted action group, so menu clicks did nothing.
std::stringstream ss;
for (int i = 0; i < (int)dbus_name.length(); i++)
{
ss << map[dbus_name[i]];
const char c = dbus_name[i];
if (map.count(c))
{
ss << map[c];
} else if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')))
{
ss << c;
} else
{
ss << 'y';
}
}

return ss.str();
Expand Down
Loading