internal: minor style fixes

This commit is contained in:
Vaxry 2023-06-20 21:35:54 +02:00
parent 2295bbdd80
commit cabdf38ce4
2 changed files with 11 additions and 15 deletions

View file

@ -1830,9 +1830,8 @@ void CKeybindManager::dpms(std::string arg) {
bool enable = arg.find("on") == 0;
std::string port = "";
if (arg.find_first_of(' ') != std::string::npos) {
if (arg.find_first_of(' ') != std::string::npos)
port = arg.substr(arg.find_first_of(' ') + 1);
}
for (auto& m : g_pCompositor->m_vMonitors) {
@ -1905,11 +1904,10 @@ void CKeybindManager::pinActive(std::string args) {
CWindow* PWINDOW = nullptr;
if (args != "" && args != "active" && args.length() > 1) {
if (args != "" && args != "active" && args.length() > 1)
PWINDOW = g_pCompositor->getWindowByRegex(args);
} else {
else
PWINDOW = g_pCompositor->m_pLastWindow;
}
if (!PWINDOW) {
Debug::log(ERR, "pin: window not found");
@ -1986,29 +1984,28 @@ void CKeybindManager::fakeFullscreenActive(std::string args) {
}
void CKeybindManager::lockGroups(std::string args) {
if (args == "lock" || args.empty() || args == "lockgroups") {
if (args == "lock" || args.empty() || args == "lockgroups")
g_pKeybindManager->m_bGroupsLocked = true;
} else if (args == "toggle") {
else if (args == "toggle")
g_pKeybindManager->m_bGroupsLocked = !g_pKeybindManager->m_bGroupsLocked;
} else {
else
g_pKeybindManager->m_bGroupsLocked = false;
}
}
void CKeybindManager::lockActiveGroup(std::string args) {
const auto PWINDOW = g_pCompositor->m_pLastWindow;
if (!PWINDOW || !PWINDOW->m_sGroupData.pNextWindow)
return;
const auto PHEAD = PWINDOW->getGroupHead();
if (args == "lock") {
if (args == "lock")
PHEAD->m_sGroupData.locked = true;
} else if (args == "toggle") {
else if (args == "toggle")
PHEAD->m_sGroupData.locked = !PHEAD->m_sGroupData.locked;
} else {
else
PHEAD->m_sGroupData.locked = false;
}
g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW);
}

View file

@ -42,9 +42,8 @@ bool CLayoutManager::removeLayout(IHyprLayout* layout) {
if (IT == m_vLayouts.end() || IT->first == "dwindle" || IT->first == "master")
return false;
if (m_iCurrentLayoutID == IT - m_vLayouts.begin()) {
if (m_iCurrentLayoutID == IT - m_vLayouts.begin())
switchToLayout("dwindle");
}
Debug::log(LOG, "Removed a layout %s at %lx", IT->first.c_str(), layout);