mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 22:51:58 -07:00
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
This commit is contained in:
@@ -172,7 +172,7 @@ void CHyprMasterLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dire
|
||||
} else if (WINDOWSONWORKSPACE == 2) {
|
||||
// when dropping as the second tiled window in the workspace,
|
||||
// make it the master only if the cursor is on the master side of the screen
|
||||
for (auto& nd : m_lMasterNodesData) {
|
||||
for (auto const& nd : m_lMasterNodesData) {
|
||||
if (nd.isMaster && nd.workspaceID == PNODE->workspaceID) {
|
||||
switch (orientation) {
|
||||
case ORIENTATION_LEFT:
|
||||
@@ -619,7 +619,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
|
||||
CMonitor* PMONITOR = nullptr;
|
||||
|
||||
if (g_pCompositor->isWorkspaceSpecial(pNode->workspaceID)) {
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
for (auto const& m : g_pCompositor->m_vMonitors) {
|
||||
if (m->activeSpecialWorkspaceID() == pNode->workspaceID) {
|
||||
PMONITOR = m.get();
|
||||
break;
|
||||
@@ -1106,7 +1106,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
|
||||
const auto NEWFOCUS = newFocusToChild ? NEWCHILD : NEWMASTER;
|
||||
switchToWindow(NEWFOCUS);
|
||||
} else {
|
||||
for (auto& n : m_lMasterNodesData) {
|
||||
for (auto const& n : m_lMasterNodesData) {
|
||||
if (n.workspaceID == PMASTER->workspaceID && !n.isMaster) {
|
||||
const auto NEWMASTER = n.pWindow.lock();
|
||||
switchWindows(NEWMASTER, NEWCHILD);
|
||||
@@ -1141,7 +1141,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
|
||||
return 0;
|
||||
} else {
|
||||
// if master is focused keep master focused (don't do anything)
|
||||
for (auto& n : m_lMasterNodesData) {
|
||||
for (auto const& n : m_lMasterNodesData) {
|
||||
if (n.workspaceID == PMASTER->workspaceID && !n.isMaster) {
|
||||
switchToWindow(n.pWindow.lock());
|
||||
break;
|
||||
@@ -1469,7 +1469,7 @@ Vector2D CHyprMasterLayout::predictSizeForNewWindowTiled() {
|
||||
}
|
||||
|
||||
void CHyprMasterLayout::onEnable() {
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
for (auto const& w : g_pCompositor->m_vWindows) {
|
||||
if (w->m_bIsFloating || !w->m_bIsMapped || w->isHidden())
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user