mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-01 12:41:55 -07:00
binds: cycle within group on single monitor if no window found in the argument direction. (#8714)
This commit is contained in:
@@ -1395,19 +1395,18 @@ SDispatchResult CKeybindManager::moveFocusTo(std::string args) {
|
|||||||
g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
|
g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
|
||||||
|
|
||||||
// Prioritize focus change within groups if the window is a part of it.
|
// Prioritize focus change within groups if the window is a part of it.
|
||||||
if (*PGROUPCYCLE) {
|
if (*PGROUPCYCLE && PLASTWINDOW->m_sGroupData.pNextWindow) {
|
||||||
if (!PLASTWINDOW->m_sGroupData.pNextWindow.expired()) {
|
auto isTheOnlyGroupOnWs = !PWINDOWTOCHANGETO && g_pCompositor->m_vMonitors.size() == 1;
|
||||||
if (arg == 'l' && PLASTWINDOW != PLASTWINDOW->getGroupHead()) {
|
if (arg == 'l' && (PLASTWINDOW != PLASTWINDOW->getGroupHead() || isTheOnlyGroupOnWs)) {
|
||||||
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->getGroupPrevious());
|
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->getGroupPrevious());
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (arg == 'r' && PLASTWINDOW != PLASTWINDOW->getGroupTail()) {
|
else if (arg == 'r' && (PLASTWINDOW != PLASTWINDOW->getGroupTail() || isTheOnlyGroupOnWs)) {
|
||||||
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->m_sGroupData.pNextWindow.lock());
|
PLASTWINDOW->setGroupCurrent(PLASTWINDOW->m_sGroupData.pNextWindow.lock());
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Found window in direction, switch to it
|
// Found window in direction, switch to it
|
||||||
if (PWINDOWTOCHANGETO) {
|
if (PWINDOWTOCHANGETO) {
|
||||||
|
Reference in New Issue
Block a user