windowrules: check if floating when resizing from maxsize (#5019)

* check if floating

* use return
This commit is contained in:
Epilepsy Gatherings 2024-03-08 09:54:45 -05:00 committed by GitHub
parent e52d3fa852
commit 1290507ac4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -689,6 +689,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
Debug::log(ERR, "Rule idleinhibit: unknown mode {}", IDLERULE); Debug::log(ERR, "Rule idleinhibit: unknown mode {}", IDLERULE);
} else if (r.szRule.starts_with("maxsize")) { } else if (r.szRule.starts_with("maxsize")) {
try { try {
if (!m_bIsFloating)
return;
m_sAdditionalConfigData.maxSize = configStringToVector2D(r.szRule.substr(8)); m_sAdditionalConfigData.maxSize = configStringToVector2D(r.szRule.substr(8));
m_vRealSize = Vector2D(std::min((double)m_sAdditionalConfigData.maxSize.toUnderlying().x, m_vRealSize.goal().x), m_vRealSize = Vector2D(std::min((double)m_sAdditionalConfigData.maxSize.toUnderlying().x, m_vRealSize.goal().x),
std::min((double)m_sAdditionalConfigData.maxSize.toUnderlying().y, m_vRealSize.goal().y)); std::min((double)m_sAdditionalConfigData.maxSize.toUnderlying().y, m_vRealSize.goal().y));
@ -697,6 +699,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
} catch (std::exception& e) { Debug::log(ERR, "maxsize rule \"{}\" failed with: {}", r.szRule, e.what()); } } catch (std::exception& e) { Debug::log(ERR, "maxsize rule \"{}\" failed with: {}", r.szRule, e.what()); }
} else if (r.szRule.starts_with("minsize")) { } else if (r.szRule.starts_with("minsize")) {
try { try {
if (!m_bIsFloating)
return;
m_sAdditionalConfigData.minSize = configStringToVector2D(r.szRule.substr(8)); m_sAdditionalConfigData.minSize = configStringToVector2D(r.szRule.substr(8));
m_vRealSize = Vector2D(std::max((double)m_sAdditionalConfigData.minSize.toUnderlying().x, m_vRealSize.goal().x), m_vRealSize = Vector2D(std::max((double)m_sAdditionalConfigData.minSize.toUnderlying().x, m_vRealSize.goal().x),
std::max((double)m_sAdditionalConfigData.minSize.toUnderlying().y, m_vRealSize.goal().y)); std::max((double)m_sAdditionalConfigData.minSize.toUnderlying().y, m_vRealSize.goal().y));