mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 09:46:00 +01:00
formating
This commit is contained in:
parent
b4348c74e4
commit
3b01541ad2
3 changed files with 15 additions and 17 deletions
|
@ -28,8 +28,7 @@
|
||||||
#include "hyprerror/HyprError.hpp"
|
#include "hyprerror/HyprError.hpp"
|
||||||
#include "plugins/PluginSystem.hpp"
|
#include "plugins/PluginSystem.hpp"
|
||||||
|
|
||||||
enum eManagersInitStage
|
enum eManagersInitStage {
|
||||||
{
|
|
||||||
STAGE_PRIORITY = 0,
|
STAGE_PRIORITY = 0,
|
||||||
STAGE_LATE
|
STAGE_LATE
|
||||||
};
|
};
|
||||||
|
|
|
@ -1158,16 +1158,15 @@ void CConfigManager::handleWorkspaceRules(const std::string& command, const std:
|
||||||
wsRule.monitor = rule.substr(delim + 8);
|
wsRule.monitor = rule.substr(delim + 8);
|
||||||
else if ((delim = rule.find("default:")) != std::string::npos)
|
else if ((delim = rule.find("default:")) != std::string::npos)
|
||||||
wsRule.isDefault = configStringToInt(rule.substr(delim + 8));
|
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");
|
size_t silent = rule.find("silent");
|
||||||
if (silent != std::string::npos) {
|
if (silent != std::string::npos) {
|
||||||
wsRule.maxClientsSilent = true;
|
wsRule.maxClientsSilent = true;
|
||||||
wsRule.maxClients = configStringToInt(rule.substr(delim + 11, silent));
|
wsRule.maxClients = configStringToInt(rule.substr(delim + 11, silent));
|
||||||
} else {
|
} else {
|
||||||
wsRule.maxClients = configStringToInt(rule.substr(delim + 11));
|
wsRule.maxClients = configStringToInt(rule.substr(delim + 11));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
|
|
|
@ -577,8 +577,8 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
auto workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{};
|
auto workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{};
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
|
||||||
|
|
||||||
int maxClients = workspaceRule.maxClients;
|
int maxClients = workspaceRule.maxClients;
|
||||||
bool maxClientsSilent = workspaceRule.maxClientsSilent;
|
bool maxClientsSilent = workspaceRule.maxClientsSilent;
|
||||||
if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) {
|
if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) {
|
||||||
if (pWorkspace->m_bIsSpecialWorkspace) {
|
if (pWorkspace->m_bIsSpecialWorkspace) {
|
||||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace));
|
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);
|
pWorkspace = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
|
||||||
workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{};
|
workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{};
|
||||||
maxClients = workspaceRule.maxClients;
|
maxClients = workspaceRule.maxClients;
|
||||||
if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) {
|
if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) {
|
||||||
std::string requestedWorkspaceName;
|
std::string requestedWorkspaceName;
|
||||||
const int REQUESTEDWORKSPACEID = getWorkspaceIDFromString("empty", 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);
|
pWorkspace = g_pCompositor->createNewWorkspace(REQUESTEDWORKSPACEID, PWINDOW->m_iMonitorID, requestedWorkspaceName);
|
||||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
|
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
|
||||||
if (!maxClientsSilent)
|
if (!maxClientsSilent)
|
||||||
g_pKeybindManager->m_mDispatchers["workspace"](pWorkspace->m_szName);
|
g_pKeybindManager->m_mDispatchers["workspace"](pWorkspace->m_szName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxClientsSilent) {
|
if (maxClientsSilent) {
|
||||||
if (g_pCompositor->windowValidMapped(PFOCUSEDWINDOWPREV)) {
|
if (g_pCompositor->windowValidMapped(PFOCUSEDWINDOWPREV)) {
|
||||||
g_pCompositor->focusWindow(PFOCUSEDWINDOWPREV);
|
g_pCompositor->focusWindow(PFOCUSEDWINDOWPREV);
|
||||||
PFOCUSEDWINDOWPREV->updateWindowDecos();
|
PFOCUSEDWINDOWPREV->updateWindowDecos();
|
||||||
} else if (!PFOCUSEDWINDOWPREV)
|
} else if (!PFOCUSEDWINDOWPREV)
|
||||||
g_pCompositor->focusWindow(nullptr);
|
g_pCompositor->focusWindow(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue