mirror of https://github.com/hyprwm/Hyprland
windowrules: check if floating when resizing from maxsize (#5019)
* check if floating * use return
This commit is contained in:
parent
e52d3fa852
commit
1290507ac4
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue