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
1 changed files with 4 additions and 0 deletions

View File

@ -689,6 +689,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
Debug::log(ERR, "Rule idleinhibit: unknown mode {}", IDLERULE);
} else if (r.szRule.starts_with("maxsize")) {
try {
if (!m_bIsFloating)
return;
m_sAdditionalConfigData.maxSize = configStringToVector2D(r.szRule.substr(8));
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));
@ -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()); }
} else if (r.szRule.starts_with("minsize")) {
try {
if (!m_bIsFloating)
return;
m_sAdditionalConfigData.minSize = configStringToVector2D(r.szRule.substr(8));
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));