mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-03 13:53:09 +03:00
workspacerules: Add a persistent workspace rule (#3530)
* add persistent flag to workspace rules * get rid of unused ws->indestructible flag
This commit is contained in:
parent
7f8e0a1318
commit
df0c8e0f7a
@ -1188,8 +1188,11 @@ void CCompositor::sanityCheckWorkspaces() {
|
||||
auto it = m_vWorkspaces.begin();
|
||||
while (it != m_vWorkspaces.end()) {
|
||||
|
||||
if ((*it)->m_bIndestructible)
|
||||
const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(it->get());
|
||||
if (WORKSPACERULE.isPersistent) {
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto WINDOWSONWORKSPACE = getWindowsOnWorkspace((*it)->m_iID);
|
||||
|
||||
|
@ -1177,6 +1177,8 @@ 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("persistent:")) != std::string::npos)
|
||||
wsRule.isPersistent = configStringToInt(rule.substr(delim + 11));
|
||||
};
|
||||
|
||||
size_t pos = 0;
|
||||
|
@ -41,6 +41,7 @@ struct SWorkspaceRule {
|
||||
std::string workspaceName = "";
|
||||
int workspaceId = -1;
|
||||
bool isDefault = false;
|
||||
bool isPersistent = false;
|
||||
std::optional<int64_t> gapsIn;
|
||||
std::optional<int64_t> gapsOut;
|
||||
std::optional<int64_t> borderSize;
|
||||
|
@ -50,9 +50,6 @@ class CWorkspace {
|
||||
bool m_bDefaultFloating = false;
|
||||
bool m_bDefaultPseudo = false;
|
||||
|
||||
// don't destroy in sanity check
|
||||
bool m_bIndestructible = false;
|
||||
|
||||
// last monitor (used on reconnect)
|
||||
std::string m_szLastMonitor = "";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user