mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 19:25:59 +01:00
handle multi-ws swaps in layouts
This commit is contained in:
parent
9f82278d65
commit
037d4ed422
2 changed files with 12 additions and 8 deletions
|
@ -1008,8 +1008,8 @@ void CHyprDwindleLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PNODE->workspaceID != PNODE2->workspaceID) {
|
if (PNODE->workspaceID != PNODE2->workspaceID) {
|
||||||
Debug::log(ERR, "Dwindle: Rejecting a swap between workspaces");
|
std::swap(pWindow2->m_iMonitorID, pWindow->m_iMonitorID);
|
||||||
return;
|
std::swap(pWindow2->m_iWorkspaceID, pWindow->m_iWorkspaceID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// swap the windows and recalc
|
// swap the windows and recalc
|
||||||
|
@ -1018,6 +1018,9 @@ void CHyprDwindleLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) {
|
||||||
|
|
||||||
// recalc the workspace
|
// recalc the workspace
|
||||||
getMasterNodeOnWorkspace(PNODE->workspaceID)->recalcSizePosRecursive();
|
getMasterNodeOnWorkspace(PNODE->workspaceID)->recalcSizePosRecursive();
|
||||||
|
|
||||||
|
if (PNODE2->workspaceID != PNODE->workspaceID)
|
||||||
|
getMasterNodeOnWorkspace(PNODE2->workspaceID)->recalcSizePosRecursive();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprDwindleLayout::alterSplitRatioBy(CWindow* pWindow, float ratio) {
|
void CHyprDwindleLayout::alterSplitRatioBy(CWindow* pWindow, float ratio) {
|
||||||
|
|
|
@ -425,16 +425,17 @@ void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PNODE->workspaceID != PNODE2->workspaceID) {
|
if (PNODE->workspaceID != PNODE2->workspaceID) {
|
||||||
Debug::log(ERR, "Master: Rejecting a swap between workspaces");
|
std::swap(pWindow2->m_iMonitorID, pWindow->m_iMonitorID);
|
||||||
return;
|
std::swap(pWindow2->m_iWorkspaceID, pWindow->m_iWorkspaceID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// massive hack: just swap window pointers, lol
|
// massive hack: just swap window pointers, lol
|
||||||
const auto PWINDOW1 = PNODE->pWindow;
|
PNODE->pWindow = pWindow2;
|
||||||
PNODE->pWindow = PNODE2->pWindow;
|
PNODE2->pWindow = pWindow;
|
||||||
PNODE2->pWindow = PWINDOW1;
|
|
||||||
|
|
||||||
recalculateMonitor(PWINDOW1->m_iMonitorID);
|
recalculateMonitor(pWindow->m_iMonitorID);
|
||||||
|
if (PNODE2->workspaceID != PNODE->workspaceID)
|
||||||
|
recalculateMonitor(pWindow2->m_iMonitorID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprMasterLayout::alterSplitRatioBy(CWindow* pWindow, float ratio) {
|
void CHyprMasterLayout::alterSplitRatioBy(CWindow* pWindow, float ratio) {
|
||||||
|
|
Loading…
Reference in a new issue