From 1290507ac418bd48490522da9bf612d271e87010 Mon Sep 17 00:00:00 2001 From: Epilepsy Gatherings <73647246+phonetic112@users.noreply.github.com> Date: Fri, 8 Mar 2024 09:54:45 -0500 Subject: [PATCH] windowrules: check if floating when resizing from maxsize (#5019) * check if floating * use return --- src/Window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Window.cpp b/src/Window.cpp index 85608f6f..8bc16f1b 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -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));