Slightly better behavior with LRTB master layouts (still has issues)

This commit is contained in:
Marcus Kellerman 2023-02-26 21:16:07 -08:00
parent bb37d53603
commit 2d758dfd96

View file

@ -577,16 +577,12 @@ void CHyprMasterLayout::resizeActiveWindow(const Vector2D& pixResize, CWindow* p
case ORIENTATION_TOP: delta = pixResize.y / PMONITOR->vecSize.y; break;
case ORIENTATION_CENTER:
delta = pixResize.x / PMONITOR->vecSize.x;
if (!PNODE->isMaster)
// Need to account for slave windows on both sides of master
delta *= 2.0;
// Need to account for slave windows on both sides of master
delta = PNODE->isMaster ? delta : delta * -2.0;
break;
default: UNREACHABLE();
}
if (!PNODE->isMaster)
delta *= -1.0;
for (auto& n : m_lMasterNodesData) {
if (n.isMaster && n.workspaceID == PMONITOR->activeWorkspace)
n.percMaster = std::clamp(n.percMaster + delta, 0.05, 0.95);