mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-22 23:21:39 +03:00
binds: cycle within group on single monitor if no window found in the argument direction. (#8714)
This commit is contained in:
parent
c7d9719910
commit
bd7092a9fe
@ -1395,17 +1395,16 @@ SDispatchResult CKeybindManager::moveFocusTo(std::string args) {
|
||||
g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
|
||||
|
||||
// Prioritize focus change within groups if the window is a part of it.
|
||||
if (*PGROUPCYCLE) {
|
||||
if (!PLASTWINDOW->m_sGroupData.pNextWindow.expired()) {
|
||||
if (arg == 'l' && PLASTWINDOW != PLASTWINDOW->getGroupHead()) {
|
||||
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->getGroupPrevious());
|
||||
return {};
|
||||
}
|
||||
if (*PGROUPCYCLE && PLASTWINDOW->m_sGroupData.pNextWindow) {
|
||||
auto isTheOnlyGroupOnWs = !PWINDOWTOCHANGETO && g_pCompositor->m_vMonitors.size() == 1;
|
||||
if (arg == 'l' && (PLASTWINDOW != PLASTWINDOW->getGroupHead() || isTheOnlyGroupOnWs)) {
|
||||
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->getGroupPrevious());
|
||||
return {};
|
||||
}
|
||||
|
||||
else if (arg == 'r' && PLASTWINDOW != PLASTWINDOW->getGroupTail()) {
|
||||
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->m_sGroupData.pNextWindow.lock());
|
||||
return {};
|
||||
}
|
||||
else if (arg == 'r' && (PLASTWINDOW != PLASTWINDOW->getGroupTail() || isTheOnlyGroupOnWs)) {
|
||||
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->m_sGroupData.pNextWindow.lock());
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user