mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 16:45:59 +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
|
||||
? (arg == 'd' || arg == 'b' || arg == 'r'
|
||||
? g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW, true)
|
||||
: g_pCompositor->getPrevWindowOnWorkspace(PLASTWINDOW, true))
|
||||
: g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
|
||||
const auto PWINDOWTOCHANGETO = PLASTWINDOW->m_bIsFullscreen ?
|
||||
(arg == 'd' || arg == 'b' || arg == 'r' ? g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW, true) : g_pCompositor->getPrevWindowOnWorkspace(PLASTWINDOW, true)) :
|
||||
g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
|
||||
|
||||
// Found window in direction, switch to it
|
||||
if (PWINDOWTOCHANGETO) {
|
||||
|
@ -2088,6 +2086,9 @@ void CKeybindManager::moveGroupWindow(std::string args) {
|
|||
if (!g_pCompositor->m_pLastWindow || !g_pCompositor->m_pLastWindow->m_sGroupData.pNextWindow)
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue