useractions: remove legacy virtual desktop number from the menu

In almost all cases it's duplicated in the name, and if the user manually
changes the name, the custom name should be shown without additional numbers

CCBUG: 481576
This commit is contained in:
Xaver Hugl 2024-02-20 17:22:05 +01:00 committed by Vlad Zahorodnii
parent f77f5b2342
commit 0bd65de375

View file

@ -494,17 +494,9 @@ void UserActionsMenu::desktopPopupAboutToShow()
m_desktopMenu->addSeparator();
const uint BASE = 10;
const auto desktops = vds->desktops();
for (VirtualDesktop *desktop : desktops) {
const uint legacyId = desktop->x11DesktopNumber();
QString basic_name(QStringLiteral("%1 %2"));
if (legacyId < BASE) {
basic_name.prepend(QLatin1Char('&'));
}
action = m_desktopMenu->addAction(basic_name.arg(legacyId).arg(desktop->name().replace(QLatin1Char('&'), QStringLiteral("&&"))));
action = m_desktopMenu->addAction(QStringLiteral("%1").arg(desktop->name().replace(QLatin1Char('&'), QStringLiteral("&&"))));
connect(action, &QAction::triggered, this, [this, desktop]() {
if (m_window) {
workspace()->sendWindowToDesktops(m_window, {desktop}, false);