diff options
| author | MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> | 2023-07-11 09:29:19 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-11 11:29:19 +0200 |
| commit | 29d017f54bc4b41ec402e6ac91d4857b8305483a (patch) | |
| tree | bebec674bfc840573fce61349428e411f8bdbc6a /src/config/ConfigManager.cpp | |
| parent | 26579fa9627c46af851efea1381e910ea48e3e73 (diff) | |
monitor desc default workspace but working now (#2678)
* fix desc check
* fixes crashes when nulptr
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index b5fcf0fa..56c55f3b 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -2195,8 +2195,15 @@ void CConfigManager::removePluginConfig(HANDLE handle) { std::string CConfigManager::getDefaultWorkspaceFor(const std::string& name) { for (auto other = m_dWorkspaceRules.begin(); other != m_dWorkspaceRules.end(); ++other) { - if (other->isDefault && (other->monitor == name || (other->monitor.substr(0, 5) == "desc:" && g_pCompositor->getMonitorFromDesc(other->monitor.substr(5))->szName == name))) - return other->workspaceString; + if (other->isDefault) { + if (other->monitor == name) + return other->workspaceString; + if (other->monitor.substr(0, 5) == "desc:") { + auto monitor = g_pCompositor->getMonitorFromDesc(other->monitor.substr(5)); + if (monitor && monitor->szName == name) + return other->workspaceString; + } + } } return ""; } |
