mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 12:46:00 +01:00
dispatchers: support number as arg in changegroupactive (#3329)
This commit is contained in:
parent
8637bfb1b7
commit
8252957392
1 changed files with 12 additions and 0 deletions
|
@ -1172,6 +1172,18 @@ void CKeybindManager::changeGroupActive(std::string args) {
|
|||
if (PWINDOW->m_sGroupData.pNextWindow == PWINDOW)
|
||||
return;
|
||||
|
||||
if (isNumber(args, false)) {
|
||||
// index starts from '1'; '0' means last window
|
||||
const int INDEX = std::stoi(args);
|
||||
if (INDEX > PWINDOW->getGroupSize())
|
||||
return;
|
||||
if (INDEX == 0)
|
||||
PWINDOW->setGroupCurrent(PWINDOW->getGroupTail());
|
||||
else
|
||||
PWINDOW->setGroupCurrent(PWINDOW->getGroupWindowByIndex(INDEX - 1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (args != "b" && args != "prev") {
|
||||
PWINDOW->setGroupCurrent(PWINDOW->m_sGroupData.pNextWindow);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue