UserActionsMenu: Add "Move &To Current Desktop" action from task manager for X11
Task Manager has this option, so let's keep them consistent. Surprisingly, when a window is set to "All Desktops", choosing "All Desktops" again clears that flag, i.e. sets the window back to only single desktop. But it is not intuitive at all. So let's have this separate action to pin a window to current desktop. Note: Wayland allows for multiple but not all desktops to be assigned to a window, so it works differently there. Should we have a similar option there too? BUG: 458415
This commit is contained in:
parent
d477b31842
commit
e489ad9a16
1 changed files with 12 additions and 1 deletions
|
@ -521,7 +521,18 @@ void UserActionsMenu::desktopPopupAboutToShow()
|
|||
m_desktopMenu->setPalette(m_window->palette());
|
||||
}
|
||||
QActionGroup *group = new QActionGroup(m_desktopMenu);
|
||||
QAction *action = m_desktopMenu->addAction(i18n("&All Desktops"));
|
||||
|
||||
QAction *action = m_desktopMenu->addAction(i18n("Move &To Current Desktop"));
|
||||
action->setEnabled(m_window && (m_window->isOnAllDesktops() || !m_window->isOnDesktop(vds->currentDesktop())));
|
||||
connect(action, &QAction::triggered, this, [this]() {
|
||||
if (!m_window) {
|
||||
return;
|
||||
}
|
||||
VirtualDesktopManager *vds = VirtualDesktopManager::self();
|
||||
workspace()->sendWindowToDesktop(m_window, vds->currentDesktop()->x11DesktopNumber(), false);
|
||||
});
|
||||
|
||||
action = m_desktopMenu->addAction(i18n("&All Desktops"));
|
||||
connect(action, &QAction::triggered, this, [this]() {
|
||||
if (m_window) {
|
||||
m_window->setOnAllDesktops(!m_window->isOnAllDesktops());
|
||||
|
|
Loading…
Reference in a new issue