formating

This commit is contained in:
Lampros Pitsillos 2023-09-08 23:15:41 +03:00
parent b4348c74e4
commit 3b01541ad2
3 changed files with 15 additions and 17 deletions

View file

@ -28,8 +28,7 @@
#include "hyprerror/HyprError.hpp"
#include "plugins/PluginSystem.hpp"
enum eManagersInitStage
{
enum eManagersInitStage {
STAGE_PRIORITY = 0,
STAGE_LATE
};

View file

@ -1158,16 +1158,15 @@ void CConfigManager::handleWorkspaceRules(const std::string& command, const std:
wsRule.monitor = rule.substr(delim + 8);
else if ((delim = rule.find("default:")) != std::string::npos)
wsRule.isDefault = configStringToInt(rule.substr(delim + 8));
else if ((delim = rule.find("maxclients:")) != std::string::npos){
else if ((delim = rule.find("maxclients:")) != std::string::npos) {
size_t silent = rule.find("silent");
if (silent != std::string::npos) {
wsRule.maxClientsSilent = true;
wsRule.maxClients = configStringToInt(rule.substr(delim + 11, silent));
} else {
wsRule.maxClients = configStringToInt(rule.substr(delim + 11));
}
if (silent != std::string::npos) {
wsRule.maxClientsSilent = true;
wsRule.maxClients = configStringToInt(rule.substr(delim + 11, silent));
} else {
wsRule.maxClients = configStringToInt(rule.substr(delim + 11));
}
}
};
size_t pos = 0;

View file

@ -577,8 +577,8 @@ void Events::listener_mapWindow(void* owner, void* data) {
auto workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{};
const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
int maxClients = workspaceRule.maxClients;
bool maxClientsSilent = workspaceRule.maxClientsSilent;
int maxClients = workspaceRule.maxClients;
bool maxClientsSilent = workspaceRule.maxClientsSilent;
if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) {
if (pWorkspace->m_bIsSpecialWorkspace) {
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace));
@ -588,7 +588,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
pWorkspace = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{};
maxClients = workspaceRule.maxClients;
maxClients = workspaceRule.maxClients;
if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) {
std::string requestedWorkspaceName;
const int REQUESTEDWORKSPACEID = getWorkspaceIDFromString("empty", requestedWorkspaceName);
@ -596,15 +596,15 @@ void Events::listener_mapWindow(void* owner, void* data) {
pWorkspace = g_pCompositor->createNewWorkspace(REQUESTEDWORKSPACEID, PWINDOW->m_iMonitorID, requestedWorkspaceName);
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
if (!maxClientsSilent)
g_pKeybindManager->m_mDispatchers["workspace"](pWorkspace->m_szName);
g_pKeybindManager->m_mDispatchers["workspace"](pWorkspace->m_szName);
}
if (maxClientsSilent) {
if (g_pCompositor->windowValidMapped(PFOCUSEDWINDOWPREV)) {
g_pCompositor->focusWindow(PFOCUSEDWINDOWPREV);
PFOCUSEDWINDOWPREV->updateWindowDecos();
g_pCompositor->focusWindow(PFOCUSEDWINDOWPREV);
PFOCUSEDWINDOWPREV->updateWindowDecos();
} else if (!PFOCUSEDWINDOWPREV)
g_pCompositor->focusWindow(nullptr);
g_pCompositor->focusWindow(nullptr);
}
}
}