mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 22:51:58 -07:00
monitor desc default workspace but working now (#2678)
* fix desc check * fixes crashes when nulptr
This commit is contained in:
@@ -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 "";
|
||||
}
|
||||
|
Reference in New Issue
Block a user