mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 00:42:11 +01:00
keybinds: movegroupwindow-improvement (#2740)
* movegroupwindow-improvement * use std::swap
This commit is contained in:
parent
ce9c5fd722
commit
3b03597784
1 changed files with 7 additions and 6 deletions
|
@ -1013,11 +1013,9 @@ void CKeybindManager::moveFocusTo(std::string args) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto PWINDOWTOCHANGETO = PLASTWINDOW->m_bIsFullscreen
|
const auto PWINDOWTOCHANGETO = PLASTWINDOW->m_bIsFullscreen ?
|
||||||
? (arg == 'd' || arg == 'b' || arg == 'r'
|
(arg == 'd' || arg == 'b' || arg == 'r' ? g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW, true) : g_pCompositor->getPrevWindowOnWorkspace(PLASTWINDOW, true)) :
|
||||||
? g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW, true)
|
g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
|
||||||
: g_pCompositor->getPrevWindowOnWorkspace(PLASTWINDOW, true))
|
|
||||||
: g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
|
|
||||||
|
|
||||||
// Found window in direction, switch to it
|
// Found window in direction, switch to it
|
||||||
if (PWINDOWTOCHANGETO) {
|
if (PWINDOWTOCHANGETO) {
|
||||||
|
@ -2088,6 +2086,9 @@ void CKeybindManager::moveGroupWindow(std::string args) {
|
||||||
if (!g_pCompositor->m_pLastWindow || !g_pCompositor->m_pLastWindow->m_sGroupData.pNextWindow)
|
if (!g_pCompositor->m_pLastWindow || !g_pCompositor->m_pLastWindow->m_sGroupData.pNextWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_pCompositor->m_pLastWindow->switchWithWindowInGroup(BACK ? g_pCompositor->m_pLastWindow->getGroupPrevious() : g_pCompositor->m_pLastWindow->m_sGroupData.pNextWindow);
|
if ((!BACK && g_pCompositor->m_pLastWindow->m_sGroupData.pNextWindow->m_sGroupData.head) || (BACK && g_pCompositor->m_pLastWindow->m_sGroupData.head))
|
||||||
|
std::swap(g_pCompositor->m_pLastWindow->m_sGroupData.head, g_pCompositor->m_pLastWindow->m_sGroupData.pNextWindow->m_sGroupData.head);
|
||||||
|
else
|
||||||
|
g_pCompositor->m_pLastWindow->switchWithWindowInGroup(BACK ? g_pCompositor->m_pLastWindow->getGroupPrevious() : g_pCompositor->m_pLastWindow->m_sGroupData.pNextWindow);
|
||||||
g_pCompositor->m_pLastWindow->updateWindowDecos();
|
g_pCompositor->m_pLastWindow->updateWindowDecos();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue